-
Notifications
You must be signed in to change notification settings - Fork 97
242 lines (204 loc) · 7.54 KB
/
test.yml
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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
name: "Test all features"
on:
push:
branches: ["main", "release-*"]
pull_request:
workflow_dispatch:
# cancel previous runs
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
runtime-matrix:
runs-on: ubuntu-latest
outputs:
runtime: ${{ steps.runtime.outputs.runtime }}
name: Extract runtimes from matrix
steps:
- uses: actions/checkout@v2
- id: runtime
run: |
TASKS=$(echo $(cat .github/workflows/runtimes-matrix.json) | sed 's/ //g' )
echo $TASKS
echo "runtime=$TASKS" >> $GITHUB_OUTPUT
integration-test-matrix:
runs-on: ubuntu-latest
outputs:
itest: ${{ steps.itest.outputs.itest }}
name: Extract integration tests from matrix
steps:
- uses: actions/checkout@v2
- id: itest
run: |
TASKS=$(echo $(cat .github/workflows/integration-tests-matrix.json) | sed 's/ //g' )
echo $TASKS
echo "itest=$TASKS" >> $GITHUB_OUTPUT
runtime-test:
needs: [runtime-matrix]
continue-on-error: true
runs-on: ubuntu-22.04
strategy:
matrix:
runtime: ${{ fromJSON(needs.runtime-matrix.outputs.runtime) }}
steps:
- name: Cancel previous runs
uses: styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5 # v0.11.0
with:
access_token: ${{ github.token }}
- name: Install updates and protobuf-compiler
run: sudo apt update && sudo apt install --assume-yes cmake protobuf-compiler
- name: Free space on the runner
run: |
df -h
sudo apt -y autoremove --purge
sudo apt -y autoclean
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
df -h
- name: Checkout
uses: actions/checkout@v3
- name: Set rust version via common env file
run: cat .github/env >> $GITHUB_ENV
- name: Install stable toolchain
run: |
rustup install $RUST_STABLE_VERSION
rustup default $RUST_STABLE_VERSION
rustup target add wasm32-unknown-unknown
rustup component add rust-src
- name: Fetch cache
uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2.7.0
with:
shared-key: "fellowship-cache-tests"
- name: Test ${{ matrix.runtime.name }}
run: cargo test -p ${{ matrix.runtime.package }} --release --locked -q
env:
RUSTFLAGS: "-C debug-assertions -D warnings"
- name: Test all features ${{ matrix.runtime.name }}
run: cargo test -p ${{ matrix.runtime.package }} --release --locked -q --all-features
env:
RUSTFLAGS: "-C debug-assertions -D warnings"
SKIP_WASM_BUILD: 1
integration-test:
needs: [integration-test-matrix]
continue-on-error: true
runs-on: ubuntu-22.04
strategy:
matrix:
itest: ${{ fromJSON(needs.integration-test-matrix.outputs.itest) }}
steps:
- name: Cancel previous runs
uses: styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5 # v0.11.0
with:
access_token: ${{ github.token }}
- name: Install updates and protobuf-compiler
run: sudo apt update && sudo apt install --assume-yes cmake protobuf-compiler
- name: Free space on the runner
run: |
df -h
sudo apt -y autoremove --purge
sudo apt -y autoclean
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
df -h
- name: Checkout
uses: actions/checkout@v3
- name: Set rust version via common env file
run: cat .github/env >> $GITHUB_ENV
- name: Install stable toolchain
run: |
rustup install $RUST_STABLE_VERSION
rustup default $RUST_STABLE_VERSION
rustup target add wasm32-unknown-unknown
rustup component add rust-src
- name: Fetch cache
uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2.7.0
with:
shared-key: "fellowship-cache-tests"
- name: Test ${{ matrix.itest.name }}
run: cargo test -p ${{ matrix.itest.package }} --release --locked -q
env:
RUSTFLAGS: "-C debug-assertions -D warnings"
build-chain-spec-generator:
runs-on: ubuntu-latest
steps:
- name: Cancel previous runs
uses: styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5 # v0.11.0
with:
access_token: ${{ github.token }}
- name: Install updates and protobuf-compiler
run: sudo apt update && sudo apt install --assume-yes cmake protobuf-compiler
- name: Free space on the runner
run: |
df -h
sudo apt -y autoremove --purge
sudo apt -y autoclean
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
df -h
- name: Checkout
uses: actions/checkout@v3
- name: Set rust version via common env file
run: cat .github/env >> $GITHUB_ENV
- name: Install stable toolchain
run: |
rustup install $RUST_STABLE_VERSION
rustup default $RUST_STABLE_VERSION
rustup target add wasm32-unknown-unknown
rustup component add rust-src
- name: Fetch cache
uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2.7.0
with:
shared-key: "fellowship-cache-tests"
- name: Build
run: cargo test -p chain-spec-generator --release --locked -q --features=runtime-benchmarks
env:
RUSTFLAGS: "-C debug-assertions -D warnings"
SKIP_WASM_BUILD: 1
zombienet-smoke:
needs: [build-chain-spec-generator]
runs-on: ubuntu-latest
steps:
- name: Cancel previous runs
uses: styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5 # v0.11.0
with:
access_token: ${{ github.token }}
- name: Install updates and protobuf-compiler
run: sudo apt update && sudo apt install --assume-yes cmake protobuf-compiler
- name: Free space on the runner
run: |
df -h
sudo apt -y autoremove --purge
sudo apt -y autoclean
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
df -h
- name: Checkout
uses: actions/checkout@v3
- name: Set rust version via common env file
run: cat .github/env >> $GITHUB_ENV
- name: Install stable toolchain
run: |
rustup install $RUST_STABLE_VERSION
rustup default $RUST_STABLE_VERSION
rustup target add wasm32-unknown-unknown
rustup component add rust-src
- name: Fetch cache
uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2.7.0
with:
shared-key: "fellowship-cache-integration-tests"
- name: Build
run: |
cargo build -p chain-spec-generator --features fast-runtime --release --locked
- name: Zombienet smoke test
timeout-minutes: 20
run: |
export PATH=$(pwd)/target/release:$PATH
cargo test --manifest-path integration-tests/zombienet/Cargo.toml