Skip to content

Commit e973ac9

Browse files
authored
[ci] Run check-runtime-migration in GHA (#4441)
- Moved check-runtime-migration from gitlab to github - Moved `test-syscalls` and `cargo-check-all-benches` from gitlab to github
1 parent d36da12 commit e973ac9

File tree

4 files changed

+167
-133
lines changed

4 files changed

+167
-133
lines changed
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
name: check-runtime-migration
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened, ready_for_review]
6+
merge_group:
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
9+
cancel-in-progress: true
10+
11+
env:
12+
FORKLIFT_storage_s3_bucketName: ${{ secrets.FORKLIFT_storage_s3_bucketName }}
13+
FORKLIFT_storage_s3_accessKeyId: ${{ secrets.FORKLIFT_storage_s3_accessKeyId }}
14+
FORKLIFT_storage_s3_secretAccessKey: ${{ secrets.FORKLIFT_storage_s3_secretAccessKey }}
15+
FORKLIFT_storage_s3_endpointUrl: ${{ secrets.FORKLIFT_storage_s3_endpointUrl }}
16+
FORKLIFT_metrics_pushEndpoint: ${{ secrets.FORKLIFT_metrics_pushEndpoint }}
17+
18+
jobs:
19+
set-image:
20+
# GitHub Actions allows using 'env' in a container context.
21+
# However, env variables don't work for forks: https://github.com/orgs/community/discussions/44322
22+
# This workaround sets the container image for each job using 'set-image' job output.
23+
runs-on: ubuntu-latest
24+
outputs:
25+
IMAGE: ${{ steps.set_image.outputs.IMAGE }}
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v4
29+
- id: set_image
30+
run: cat .github/env >> $GITHUB_OUTPUT
31+
# rococo and westend are disabled for now (no access to parity-chains.parity.io)
32+
check-runtime-migration:
33+
runs-on: arc-runners-polkadot-sdk-beefy
34+
timeout-minutes: 30
35+
needs: [set-image]
36+
container:
37+
image: ${{ needs.set-image.outputs.IMAGE }}
38+
strategy:
39+
fail-fast: false
40+
matrix:
41+
network: [
42+
# westend,
43+
# rococo,
44+
asset-hub-westend,
45+
asset-hub-rococo,
46+
bridge-hub-westend,
47+
bridge-hub-rococo,
48+
contracts-rococo,
49+
collectives-westend,
50+
coretime-rococo,
51+
]
52+
include:
53+
# - network: westend
54+
# package: westend-runtime
55+
# wasm: westend_runtime.compact.compressed.wasm
56+
# uri: "wss://westend-try-runtime-node.parity-chains.parity.io:443"
57+
# subcommand_extra_args: "--no-weight-warnings"
58+
# command_extra_args: ""
59+
# - network: rococo
60+
# package: rococo-runtime
61+
# wasm: rococo_runtime.compact.compressed.wasm
62+
# uri: "wss://rococo-try-runtime-node.parity-chains.parity.io:443"
63+
# subcommand_extra_args: "--no-weight-warnings"
64+
# command_extra_args: ""
65+
- network: asset-hub-westend
66+
package: asset-hub-westend-runtime
67+
wasm: asset_hub_westend_runtime.compact.compressed.wasm
68+
uri: "wss://westend-asset-hub-rpc.polkadot.io:443"
69+
subcommand_extra_args: ""
70+
command_extra_args: ""
71+
- network: "asset-hub-rococo"
72+
package: "asset-hub-rococo-runtime"
73+
wasm: "asset_hub_rococo_runtime.compact.compressed.wasm"
74+
uri: "wss://rococo-asset-hub-rpc.polkadot.io:443"
75+
subcommand_extra_args: ""
76+
command_extra_args: ""
77+
- network: "bridge-hub-westend"
78+
package: "bridge-hub-westend-runtime"
79+
wasm: "bridge_hub_westend_runtime.compact.compressed.wasm"
80+
uri: "wss://westend-bridge-hub-rpc.polkadot.io:443"
81+
- network: "bridge-hub-rococo"
82+
package: "bridge-hub-rococo-runtime"
83+
wasm: "bridge_hub_rococo_runtime.compact.compressed.wasm"
84+
uri: "wss://rococo-bridge-hub-rpc.polkadot.io:443"
85+
- network: "contracts-rococo"
86+
package: "contracts-rococo-runtime"
87+
wasm: "contracts_rococo_runtime.compact.compressed.wasm"
88+
uri: "wss://rococo-contracts-rpc.polkadot.io:443"
89+
- network: "collectives-westend"
90+
package: "collectives-westend-runtime"
91+
wasm: "collectives_westend_runtime.compact.compressed.wasm"
92+
uri: "wss://westend-collectives-rpc.polkadot.io:443"
93+
command_extra_args: "--disable-spec-name-check"
94+
- network: "coretime-rococo"
95+
package: "coretime-rococo-runtime"
96+
wasm: "coretime_rococo_runtime.compact.compressed.wasm"
97+
uri: "wss://rococo-coretime-rpc.polkadot.io:443"
98+
steps:
99+
- name: Checkout
100+
uses: actions/checkout@v4
101+
- name: script
102+
run: |
103+
echo "Running ${{ matrix.network }} runtime migration check"
104+
export RUST_LOG=remote-ext=debug,runtime=debug
105+
106+
echo "---------- Downloading try-runtime CLI ----------"
107+
curl -sL https://github.com/paritytech/try-runtime-cli/releases/download/v0.5.4/try-runtime-x86_64-unknown-linux-musl -o try-runtime
108+
chmod +x ./try-runtime
109+
echo "Using try-runtime-cli version:"
110+
./try-runtime --version
111+
112+
echo "---------- Building ${{ matrix.package }} runtime ----------"
113+
time forklift cargo build --release --locked -p ${{ matrix.package }} --features try-runtime
114+
115+
echo "---------- Executing on-runtime-upgrade for ${{ matrix.network }} ----------"
116+
time ./try-runtime ${{ matrix.command_extra_args }} \
117+
--runtime ./target/release/wbuild/${{ matrix.package }}/${{ matrix.wasm }} \
118+
on-runtime-upgrade --disable-spec-version-check --checks=all ${{ matrix.subcommand_extra_args }} live --uri ${{ matrix.uri }}
119+
sleep 5

.github/workflows/test-github-actions.yml renamed to .github/workflows/tests.yml

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: test-github-actions
1+
name: tests
22

33
on:
44
pull_request:
@@ -62,3 +62,40 @@ jobs:
6262
uses: actions/checkout@v4
6363
- name: script
6464
run: time forklift cargo run --locked --release -p staging-node-cli --bin substrate-node --features runtime-benchmarks -- benchmark pallet --chain dev --pallet "*" --extrinsic "*" --steps 2 --repeat 1 --quiet
65+
# cf https://github.com/paritytech/polkadot-sdk/issues/1652
66+
test-syscalls:
67+
runs-on: arc-runners-polkadot-sdk-beefy
68+
timeout-minutes: 30
69+
needs: [set-image]
70+
container:
71+
image: ${{ needs.set-image.outputs.IMAGE }}
72+
continue-on-error: true # this rarely triggers in practice
73+
env:
74+
SKIP_WASM_BUILD: 1
75+
steps:
76+
- name: Checkout
77+
uses: actions/checkout@v4
78+
- name: script
79+
run: |
80+
forklift cargo build --locked --profile production --target x86_64-unknown-linux-musl --bin polkadot-execute-worker --bin polkadot-prepare-worker
81+
cd polkadot/scripts/list-syscalls
82+
./list-syscalls.rb ../../../target/x86_64-unknown-linux-musl/production/polkadot-execute-worker --only-used-syscalls | diff -u execute-worker-syscalls -
83+
./list-syscalls.rb ../../../target/x86_64-unknown-linux-musl/production/polkadot-prepare-worker --only-used-syscalls | diff -u prepare-worker-syscalls -
84+
# todo:
85+
# after_script:
86+
# - if [[ "$CI_JOB_STATUS" == "failed" ]]; then
87+
# printf "The x86_64 syscalls used by the worker binaries have changed. Please review if this is expected and update polkadot/scripts/list-syscalls/*-worker-syscalls as needed.\n";
88+
# fi
89+
cargo-check-all-benches:
90+
runs-on: arc-runners-polkadot-sdk-beefy
91+
timeout-minutes: 30
92+
needs: [set-image]
93+
container:
94+
image: ${{ needs.set-image.outputs.IMAGE }}
95+
env:
96+
SKIP_WASM_BUILD: 1
97+
steps:
98+
- name: Checkout
99+
uses: actions/checkout@v4
100+
- name: script
101+
run: time forklift cargo check --all --benches

.gitlab/pipeline/check.yml

Lines changed: 0 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -146,96 +146,6 @@ check-runtime-migration-rococo:
146146
URI: "wss://rococo-try-runtime-node.parity-chains.parity.io:443"
147147
SUBCOMMAND_EXTRA_ARGS: "--no-weight-warnings"
148148

149-
# Check runtime migrations for Parity managed asset hub chains
150-
check-runtime-migration-asset-hub-westend:
151-
stage: check
152-
extends:
153-
- .docker-env
154-
- .test-pr-refs
155-
- .check-runtime-migration
156-
variables:
157-
NETWORK: "asset-hub-westend"
158-
PACKAGE: "asset-hub-westend-runtime"
159-
WASM: "asset_hub_westend_runtime.compact.compressed.wasm"
160-
URI: "wss://westend-asset-hub-rpc.polkadot.io:443"
161-
162-
check-runtime-migration-asset-hub-rococo:
163-
stage: check
164-
extends:
165-
- .docker-env
166-
- .test-pr-refs
167-
- .check-runtime-migration
168-
variables:
169-
NETWORK: "asset-hub-rococo"
170-
PACKAGE: "asset-hub-rococo-runtime"
171-
WASM: "asset_hub_rococo_runtime.compact.compressed.wasm"
172-
URI: "wss://rococo-asset-hub-rpc.polkadot.io:443"
173-
174-
# Check runtime migrations for Parity managed bridge hub chains
175-
check-runtime-migration-bridge-hub-westend:
176-
stage: check
177-
extends:
178-
- .docker-env
179-
- .test-pr-refs
180-
- .check-runtime-migration
181-
variables:
182-
NETWORK: "bridge-hub-westend"
183-
PACKAGE: "bridge-hub-westend-runtime"
184-
WASM: "bridge_hub_westend_runtime.compact.compressed.wasm"
185-
URI: "wss://westend-bridge-hub-rpc.polkadot.io:443"
186-
187-
check-runtime-migration-bridge-hub-rococo:
188-
stage: check
189-
extends:
190-
- .docker-env
191-
- .test-pr-refs
192-
- .check-runtime-migration
193-
variables:
194-
NETWORK: "bridge-hub-rococo"
195-
PACKAGE: "bridge-hub-rococo-runtime"
196-
WASM: "bridge_hub_rococo_runtime.compact.compressed.wasm"
197-
URI: "wss://rococo-bridge-hub-rpc.polkadot.io:443"
198-
199-
# Check runtime migrations for Parity managed contract chains
200-
check-runtime-migration-contracts-rococo:
201-
stage: check
202-
extends:
203-
- .docker-env
204-
- .test-pr-refs
205-
- .check-runtime-migration
206-
variables:
207-
NETWORK: "contracts-rococo"
208-
PACKAGE: "contracts-rococo-runtime"
209-
WASM: "contracts_rococo_runtime.compact.compressed.wasm"
210-
URI: "wss://rococo-contracts-rpc.polkadot.io:443"
211-
212-
# Check runtime migrations for Parity managed collectives chains
213-
check-runtime-migration-collectives-westend:
214-
stage: check
215-
extends:
216-
- .docker-env
217-
- .test-pr-refs
218-
- .check-runtime-migration
219-
variables:
220-
NETWORK: "collectives-westend"
221-
PACKAGE: "collectives-westend-runtime"
222-
WASM: "collectives_westend_runtime.compact.compressed.wasm"
223-
URI: "wss://westend-collectives-rpc.polkadot.io:443"
224-
COMMAND_EXTRA_ARGS: "--disable-spec-name-check"
225-
226-
# Check runtime migrations for Parity managed coretime chain
227-
check-runtime-migration-coretime-rococo:
228-
stage: check
229-
extends:
230-
- .docker-env
231-
- .test-pr-refs
232-
- .check-runtime-migration
233-
variables:
234-
NETWORK: "coretime-rococo"
235-
PACKAGE: "coretime-rococo-runtime"
236-
WASM: "coretime_rococo_runtime.compact.compressed.wasm"
237-
URI: "wss://rococo-coretime-rpc.polkadot.io:443"
238-
239149
find-fail-ci-phrase:
240150
stage: check
241151
variables:

.gitlab/pipeline/test.yml

Lines changed: 10 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
#
2626
#
27-
#
27+
#
2828
codecov-start:
2929
stage: test
3030
when: manual
@@ -53,11 +53,11 @@ codecov-finish:
5353
extends:
5454
- .kubernetes-env
5555
- .common-refs
56-
- .pipeline-stopper-artifacts
56+
- .pipeline-stopper-artifacts
5757
needs:
5858
- test-linux-stable-codecov
5959
script:
60-
- !reference [.codecov-check, script]
60+
- !reference [.codecov-check, script]
6161
- codecovcli -v create-report-results -t ${CODECOV_TOKEN} -r paritytech/polkadot-sdk --commit-sha ${CI_COMMIT_SHA} --git-service github
6262
- codecovcli -v get-report-results -t ${CODECOV_TOKEN} -r paritytech/polkadot-sdk --commit-sha ${CI_COMMIT_SHA} --git-service github
6363
- codecovcli -v send-notifications -t ${CODECOV_TOKEN} -r paritytech/polkadot-sdk --commit-sha ${CI_COMMIT_SHA} --git-service github
@@ -78,14 +78,14 @@ test-linux-stable-codecov:
7878
RUST_TOOLCHAIN: stable
7979
RUSTFLAGS: "-Cdebug-assertions=y -Cinstrument-coverage"
8080
LLVM_PROFILE_FILE: "target/coverage/cargo-test-${CI_NODE_INDEX}-%p-%m.profraw"
81-
CARGO_INCREMENTAL: 0
82-
FORKLIFT_BYPASS: "true"
81+
CARGO_INCREMENTAL: 0
82+
FORKLIFT_BYPASS: "true"
8383
parallel: 2
8484
script:
8585
# tools
86-
- !reference [.codecov-check, script]
86+
- !reference [.codecov-check, script]
8787
- rustup component add llvm-tools-preview
88-
- mkdir -p target/coverage/result/
88+
- mkdir -p target/coverage/result/
8989
# Place real test call here
9090
- >
9191
time cargo nextest run -p polkadot \
@@ -102,15 +102,15 @@ test-linux-stable-codecov:
102102
-t lcov \
103103
--branch \
104104
-o target/coverage/result/report-${CI_NODE_INDEX}.lcov
105-
- ls -l target/coverage/result/
105+
- ls -l target/coverage/result/
106106
- >
107107
if [ "$CI_COMMIT_REF_NAME" != "master" ]; then
108108
codecovcli -v do-upload -f target/coverage/result/report-${CI_NODE_INDEX}.lcov --disable-search -t ${CODECOV_TOKEN} -r paritytech/polkadot-sdk --commit-sha ${CI_COMMIT_SHA} --fail-on-error --pr ${CI_COMMIT_REF_NAME} --git-service github;
109109
else
110110
codecovcli -v do-upload -f target/coverage/result/report-${CI_NODE_INDEX}.lcov --disable-search -t ${CODECOV_TOKEN} -r paritytech/polkadot-sdk --commit-sha ${CI_COMMIT_SHA} --fail-on-error --git-service github;
111111
fi
112-
113-
#
112+
113+
#
114114

115115
test-linux-stable:
116116
stage: test
@@ -254,18 +254,6 @@ test-rustdoc:
254254
script:
255255
- time cargo doc --workspace --all-features --no-deps
256256

257-
cargo-check-all-benches:
258-
stage: test
259-
extends:
260-
- .docker-env
261-
- .common-refs
262-
# DAG
263-
needs:
264-
- job: cargo-hfuzz
265-
artifacts: false
266-
script:
267-
- time cargo check --all --benches
268-
269257
test-node-metrics:
270258
stage: test
271259
extends:
@@ -598,26 +586,6 @@ cargo-hfuzz:
598586
- for target in $(cargo read-manifest | jq -r '.targets | .[] | .name'); do
599587
cargo hfuzz run "$target" || { printf "fuzzing failure for %s\n" "$target"; exit 1; }; done
600588

601-
# cf https://github.com/paritytech/polkadot-sdk/issues/1652
602-
test-syscalls:
603-
stage: test
604-
extends:
605-
- .docker-env
606-
- .common-refs
607-
- .run-immediately
608-
variables:
609-
SKIP_WASM_BUILD: 1
610-
script:
611-
- cargo build --locked --profile production --target x86_64-unknown-linux-musl --bin polkadot-execute-worker --bin polkadot-prepare-worker
612-
- cd polkadot/scripts/list-syscalls
613-
- ./list-syscalls.rb ../../../target/x86_64-unknown-linux-musl/production/polkadot-execute-worker --only-used-syscalls | diff -u execute-worker-syscalls -
614-
- ./list-syscalls.rb ../../../target/x86_64-unknown-linux-musl/production/polkadot-prepare-worker --only-used-syscalls | diff -u prepare-worker-syscalls -
615-
after_script:
616-
- if [[ "$CI_JOB_STATUS" == "failed" ]]; then
617-
printf "The x86_64 syscalls used by the worker binaries have changed. Please review if this is expected and update polkadot/scripts/list-syscalls/*-worker-syscalls as needed.\n";
618-
fi
619-
allow_failure: false # this rarely triggers in practice
620-
621589
.subsystem-benchmark-template:
622590
stage: test
623591
artifacts:

0 commit comments

Comments
 (0)