-
Notifications
You must be signed in to change notification settings - Fork 14
223 lines (192 loc) · 6.31 KB
/
code.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
name: code
on:
push:
branches:
- "**"
- "!gh-readonly-queue/**"
merge_group:
schedule:
- cron: "0 20 * * 0"
concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' && github.event_name != 'merge_group' }}
defaults:
run:
shell: bash
env:
CARGO_INCREMENTAL: "0"
RUSTDOCFLAGS: "-D warnings"
jobs:
plan:
name: Plan the execution
runs-on: ubuntu-22.04
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Compute matrix
uses: ./.github/actions/plan
id: set-matrix
with:
plan-name: code
test:
needs:
- plan
strategy:
matrix: ${{ fromJson(needs.plan.outputs.matrix) }}
fail-fast: false
name: ${{ matrix.plan.platform.name }} / ${{ matrix.plan.mode.name }}
runs-on: ${{ matrix.plan.platform.os }}
env: ${{ matrix.plan.platform.env }}
timeout-minutes: 50
permissions:
contents: read
steps:
- name: Job config
run: printf "%s\n" "$MATRIX_CONTEXT"
env:
MATRIX_CONTEXT: ${{ toJson(matrix) }}
- name: Checkout
uses: actions/checkout@v4
timeout-minutes: 5
- uses: ./.github/actions/common-setup
with:
platformCacheKey: ${{ matrix.plan.platform.cacheKey }}
modeCacheKey: ${{ matrix.plan.mode.cargoCacheKey }}
isOnSelfHostedRunner: ${{ matrix.plan.platform.isOnSelfHostedRunner }}
buildEnvScript: ${{ matrix.plan.platform.buildEnvScript }}
timeout-minutes: 10
- name: Run cargo ${{ matrix.plan.mode.cargoCommand }}
run: cargo ${{ matrix.plan.mode.cargoCommand }} ${{ matrix.plan.mode.cargoArgs }}
e2e:
strategy:
matrix:
test:
- suite: "base"
build-args: ""
- suite: "try-runtime"
build-args: "--features try-runtime"
fail-fast: false
name: End-to-end tests / ${{ matrix.test.suite }}
runs-on: ubuntu-22.04
timeout-minutes: 50
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
timeout-minutes: 5
- run: yarn install --immutable
- uses: ./.github/actions/common-setup
with:
platformCacheKey: ubuntu2204-amd64
buildEnvScript: .github/scripts/build_env/ubuntu.sh
timeout-minutes: 10
- name: Build binaries
run: cargo build --release --locked $BUILD_ARGS
env:
BUILD_ARGS: ${{ matrix.test.build-args }}
- name: Run bash e2e tests
run: utils/e2e-tests/bash/run-tests "$TEST_SUITE"
env:
TEST_SUITE: ${{ matrix.test.suite }}
HUMANODE_PEER_PATH: "target/release/humanode-peer"
RUNTIME_WASM_PATH: "target/release/wbuild/humanode-runtime/humanode_runtime.wasm"
- name: Run ts e2e tests
run: utils/e2e-tests/ts/run-tests "$TEST_SUITE"
env:
TEST_SUITE: ${{ matrix.test.suite }}
HUMANODE_PEER_PATH: "target/release/humanode-peer"
embedded-utils:
strategy:
matrix:
util:
- name: Require fork dependencies
run: utils/checks/require-fork-deps
- name: Check features
run: utils/checks/features
- name: Check features snapshot
run: utils/checks/features-snapshot
fail-fast: false
name: ${{ matrix.util.name }}
runs-on: ubuntu-22.04
timeout-minutes: 20
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
timeout-minutes: 5
- uses: ./.github/actions/common-setup
with:
platformCacheKey: ubuntu2204-amd64
timeout-minutes: 10
- run: ${{ matrix.util.run }}
downloadable-utils:
strategy:
matrix:
util:
- name: cargo deny
download: >
curl -sSL "https://github.com/EmbarkStudios/cargo-deny/releases/download/0.14.24/cargo-deny-0.14.24-x86_64-unknown-linux-musl.tar.gz" |
sudo tar -xzvf - -C /usr/local/bin --strip-components=1
run: cargo-deny check --hide-inclusion-graph --show-stats
requiresRust: true
- name: taplo
download: >
curl -sSL "https://github.com/tamasfe/taplo/releases/download/0.8.0/taplo-linux-x86_64.gz" |
zcat > /usr/local/bin/taplo \
&& chmod +x /usr/local/bin/taplo
run: taplo format --check
- name: cargo-sort
download: >
curl -sSL "https://github.com/DevinR528/cargo-sort/releases/download/v1.0.9/cargo-sort-x86_64-unknown-linux-gnu.tar.gz" |
sudo tar -xzvf - -C /usr/local/bin
run: cargo-sort -cwg
- name: cargo-machete
download: >
curl -sSL "https://github.com/bnjbvr/cargo-machete/releases/download/v0.6.0/cargo-machete-v0.6.0-x86_64-unknown-linux-musl.tar.gz" |
sudo tar -xzvf - --strip-components=1 -C /usr/local/bin
run: cargo-machete
- name: typos
download: >
curl -sSL "https://github.com/crate-ci/typos/releases/download/v1.21.0/typos-v1.21.0-x86_64-unknown-linux-musl.tar.gz" |
sudo tar -xzvf - -C /usr/local/bin
run: typos
fail-fast: false
name: ${{ matrix.util.name }}
runs-on: ubuntu-22.04
timeout-minutes: 20
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
timeout-minutes: 5
- uses: ./.github/actions/common-setup
with:
requiresRust: ${{ matrix.util.requiresRust }}
timeout-minutes: 10
- name: Download ${{ matrix.util.name }}
run: ${{ matrix.util.download }}
timeout-minutes: 10
- run: ${{ matrix.util.run }}
timeout-minutes: 10
prettier:
name: prettier:check
runs-on: ubuntu-22.04
timeout-minutes: 50
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
timeout-minutes: 5
- uses: actions/setup-node@v4
with:
node-version-file: .node-version
- run: yarn install --immutable
- run: yarn prettier:check