-
Notifications
You must be signed in to change notification settings - Fork 105
174 lines (148 loc) · 5.37 KB
/
CI.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
name: CI
on:
schedule:
- cron: "0 3 * * *"
push:
branches: [master, vara-stage-1, vara-stage-2, vara-stage-3]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_INCREMENTAL: 0
CARGO_TERM_COLOR: always
RUST_BACKTRACE: short
TERM: xterm-256color
BINARYEN_VERSION: version_111
jobs:
# TODO: add to specific branches.
# spec_version:
# runs-on: [kuberunner]
# steps:
# - name: "ACTIONS: Checkout"
# uses: actions/checkout@v4
# - name: "Fetch origin"
# run: git fetch origin
# - name: "Check spec version"
# if: ${{ ! contains(github.event.pull_request.labels.*.name, 'A4-insubstantial') }}
# run: ./scripts/check-spec.sh
cache:
runs-on: ubuntu-latest
outputs:
sccache_path: ${{ steps.sccache.outputs.sccache_path }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: "CACHE: Set sccache path"
id: sccache
run: |
sccache_path="/mnt/sccache/$(echo ${GITHUB_REF#refs/heads/} | tr / _)"
echo "sccache_path=$sccache_path" >> $GITHUB_OUTPUT
check:
needs: [cache]
uses: ./.github/workflows/check.yml
with:
cache: ${{ needs.cache.outputs.sccache_path }}
build:
needs: [cache]
uses: ./.github/workflows/build.yml
with:
cache: ${{ needs.cache.outputs.sccache_path }}
macos: true
build-win-native:
if: ${{ github.ref == 'refs/heads/master' }}
needs: build
runs-on: ci-win
defaults:
run:
shell: msys2 {0}
env:
CARGO_INCREMENTAL: 0
steps:
- name: "ACTIONS: Checkout"
uses: actions/checkout@v4
- name: "Install: Setup MSYS2 environment"
uses: msys2/setup-msys2@v2
with:
path-type: inherit
install: >-
procps
mingw-w64-x86_64-protobuf
- name: "Install: Rust toolchain"
uses: dsherret/rust-toolchain-file@v1
- name: "Install: cargo-nextest"
run: |
$tmp = New-TemporaryFile | Rename-Item -NewName { $_ -replace 'tmp$', 'zip' } -PassThru
Invoke-WebRequest -OutFile $tmp https://get.nexte.st/latest/windows
$outputDir = if ($Env:CARGO_HOME) { Join-Path $Env:CARGO_HOME "bin" } else { "~/.cargo/bin" }
$tmp | Expand-Archive -DestinationPath $outputDir -Force
$tmp | Remove-Item
shell: powershell
- name: "Install: cargo-hack"
run: |
$tmp = New-TemporaryFile | Rename-Item -NewName { $_ -replace 'tmp$', 'tar.gz' } -PassThru
Invoke-WebRequest -OutFile $tmp https://github.com/taiki-e/cargo-hack/releases/latest/download/cargo-hack-x86_64-pc-windows-msvc.tar.gz
$outputDir = if ($Env:CARGO_HOME) { Join-Path $Env:CARGO_HOME "bin" } else { Resolve-Path "~/.cargo/bin" }
tar zxf $tmp -C $outputDir
$tmp | Remove-Item
shell: powershell
- name: "Install: binaryen"
run: |
$tmp = New-TemporaryFile | Rename-Item -NewName { $_ -replace 'tmp$', 'tar.gz' } -PassThru
Invoke-WebRequest -OutFile $tmp "https://github.com/WebAssembly/binaryen/releases/download/$Env:BINARYEN_VERSION/binaryen-$Env:BINARYEN_VERSION-x86_64-windows.tar.gz"
$outputDir = if ($Env:CARGO_HOME) { Join-Path $Env:CARGO_HOME "bin" } else { "~/.cargo/bin" }
tar zxf $tmp
cp "./binaryen-$Env:BINARYEN_VERSION/bin/*" $outputDir
Remove-Item -Recurse "./binaryen-$Env:BINARYEN_VERSION"
$tmp | Remove-Item
shell: powershell
- name: "Install: wabt"
run: |
$tmp = New-TemporaryFile | Rename-Item -NewName { $_ -replace 'tmp$', 'tar.gz' } -PassThru
Invoke-WebRequest -OutFile $tmp https://github.com/WebAssembly/wabt/releases/download/1.0.29/wabt-1.0.29-windows.tar.gz
$outputDir = if ($Env:CARGO_HOME) { Join-Path $Env:CARGO_HOME "bin" } else { "~/.cargo/bin" }
tar zxf $tmp
cp ./wabt-1.0.29/bin/* $outputDir
Remove-Item -Recurse ./wabt-1.0.29
$tmp | Remove-Item
shell: powershell
- name: "Build: Node"
run: ./scripts/gear.sh build node --release --locked
- name: "Check: Stack height limit"
run: cargo run -p calc-stack-height --release --locked
- name: "Test: gsdk tests"
run: ./scripts/gear.sh test gsdk --release
- name: "Test: Client tests"
run: ./scripts/gear.sh test client --release
- name: "Test: Lazy pages"
run: >-
cargo nextest run
-p "pallet-*"
-p gear-lazy-pages
-p gear-runtime-interface
--release
upload:
if: github.event_name == 'push' && github.ref_name == 'master'
runs-on: ubuntu-latest
needs: build
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
- name: Delete previous release
uses: dev-drprasad/delete-tag-and-release@v1.0.1
with:
delete_release: true
tag_name: build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Sleep
run: sleep 10
- name: Upload
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
prerelease: true
tag_name: build
draft: false
fail_on_unmatched_files: true
files: artifact/*