Skip to content

Commit 01384f0

Browse files
committed
ci: try-runtime gh action
1 parent e6738b6 commit 01384f0

10 files changed

+193
-216
lines changed

.github/workflows/clippy-check.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
on: push
22
name: Clippy check
3+
concurrency:
4+
group: ${{ github.ref }}
5+
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
36

4-
# Make sure CI fails on all warnings, including Clippy lints
57
env:
68
RUSTFLAGS: "-Dwarnings"
79

810
jobs:
911
clippy_check:
10-
runs-on: [self-hosted]
12+
runs-on: ubuntu-latest
1113
services:
1214
docker:
1315
image: docker:20.10.8-dind
14-
privileged: true
1516
container:
1617
image: paritytech/ci-unified:bullseye-1.77.0
1718
steps:

.github/workflows/try-runtime.yml

+29-21
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,41 @@
11
name: try-runtime Workflow
2+
concurrency:
3+
group: ${{ github.ref }}
4+
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
25

3-
on: [pull_request]
4-
6+
on: push
57
jobs:
6-
build:
8+
test-try-runtime:
79
strategy:
810
matrix:
9-
runtime: [ peregrine, spiritnet ]
10-
uri: [ 'wss://peregrine.kilt.io:443', 'wss://peregrine.kilt.io:443' ]
11-
runs-on: [ self-hosted ]
12-
services:
13-
docker:
14-
image: docker:20.10.8-dind
15-
privileged: true
11+
runtime: [peregrine, spiritnet]
12+
uri: ['wss://peregrine.kilt.io', 'wss://spiritnet.kilt.io']
13+
exclude:
14+
- runtime: peregrine
15+
uri: 'wss://spiritnet.kilt.io'
16+
- runtime: spiritnet
17+
uri: 'wss://peregrine.kilt.io'
18+
runs-on: ubuntu-latest
1619
container:
1720
image: paritytech/ci-unified:bullseye-1.77.0
1821

1922
steps:
2023
- name: Checkout code
21-
uses: actions/checkout@v2
24+
uses: actions/checkout@v4
25+
26+
- name: script
27+
run: |
28+
echo "Running ${{ matrix.runtime }} runtime migration check"
29+
30+
echo "---------- Downloading try-runtime CLI ----------"
31+
curl -sL https://github.com/paritytech/try-runtime-cli/releases/download/v0.7.0/try-runtime-x86_64-unknown-linux-musl -o try-runtime
32+
chmod +x ./try-runtime
33+
echo "Using try-runtime-cli version:"
34+
./try-runtime --version
2235
23-
- name: Build
24-
run: cargo build --release -p ${{ matrix.runtime }}-runtime --features try-runtime --locked
36+
echo "---------- Building ${{ matrix.runtime }} runtime ----------"
37+
cargo build --release --locked -p ${{ matrix.runtime }}-runtime --features try-runtime
2538
26-
- name: Run tests
27-
uses: NodleCode/action-try-runtime@v0.5.1
28-
with:
29-
url: ${matrix.uri}
30-
snap: snapshots/eden-snapshot-full
31-
runtime: target/release/wbuild/${metrix.runtime}-runtime/peregrine_runtime.compact.compressed.wasm
32-
checks: "all"
33-
options: "----disable-spec-version-check"
39+
echo "---------- Executing on-runtime-upgrade for ${{ matrix.uri }} ----------"
40+
./try-runtime --runtime ./target/release/wbuild/${{ matrix.runtime }}-runtime/${{ matrix.runtime }}_runtime.compact.compressed.wasm \
41+
on-runtime-upgrade --disable-spec-version-check --checks=all ${{ matrix.subcommand_extra_args }} live --uri ${{ matrix.uri }}

.gitlab-ci.yml

+4-12
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,19 @@
1+
default:
2+
interruptible: true
13
include:
2-
- local: '.gitlab/check-skip.yml'
4+
- local: '.gitlab/check.yml'
35
- local: '.gitlab/test.yml'
46
- local: '.gitlab/build.yml'
5-
- local: '.gitlab/release.yml'
67

78
variables:
89
CARGO_HOME: $CI_PROJECT_DIR/.cargo
910
CARGO_TARGET_DIR: $CI_PROJECT_DIR/target
10-
default:
11-
cache:
12-
key: ${CI_COMMIT_REF_SLUG}-rust
13-
paths:
14-
- target
15-
- .cargo/bin/
16-
- .cargo/registry/index/
17-
- .cargo/registry/cache/
18-
- .cargo/git/db/
1911

2012
workflow:
2113
auto_cancel:
2214
on_new_commit: interruptible
2315

2416
stages:
17+
- check
2518
- test
2619
- build
27-
- release

.gitlab/build.yml

+46-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
build:
2-
interruptible: true
32
timeout: 2 hours
43
image:
54
name: kiltprotocol/kilt-ci:2.7.31
@@ -28,4 +27,50 @@ build:
2827
- "if [[ ! -z ${CI_COMMIT_BRANCH} ]]; then ./.maintain/push-image.sh build latest-${CI_COMMIT_BRANCH}; fi"
2928
- "if [[ ! -z ${CI_COMMIT_TAG} ]]; then ./.maintain/push-image.sh build ${CI_COMMIT_TAG}; fi"
3029
- "if [[ ! -z ${CI_COMMIT_TAG} && ! -z ${CI_COMMIT_TAG##*-rc*} && ! -z ${CI_COMMIT_TAG##*dev-*} ]]; then ./.maintain/push-image.sh build latest; fi"
30+
cache:
31+
key: cache-build
32+
paths:
33+
- target/
34+
- .cargo/bin/
35+
- .cargo/registry/index/
36+
- .cargo/registry/cache/
37+
- .cargo/git/db/
3138

39+
build-wasm:
40+
image:
41+
name: paritytech/srtool:1.77.0
42+
entrypoint: [""]
43+
stage: build
44+
only:
45+
- develop
46+
- master
47+
- /^[0-9]+(?:\.[0-9]+){2}(?:-(rc)*([0-9])+)?$/
48+
parallel:
49+
matrix:
50+
- RUNTIME: "peregrine"
51+
ENDPOINT: "wss://peregrine.kilt.io"
52+
- RUNTIME: "spiritnet"
53+
ENDPOINT: "wss://spiritnet.kilt.io"
54+
script:
55+
- export PACKAGE=${RUNTIME}-runtime
56+
- export RUNTIME_DIR=runtimes/${RUNTIME}
57+
- export PARACHAIN_PALLET_ID=0x50
58+
- export AUTHORIZE_UPGRADE_PREFIX=0x02
59+
- cp -r * /build
60+
- /srtool/build build
61+
- subwasm meta --format=json+scale /out/${RUNTIME}_runtime.compact.wasm > /out/${RUNTIME}-metadata.json
62+
- subwasm get -o ${RUNTIME}-live.wasm ${ENDPOINT}
63+
- subwasm diff --no-color ${RUNTIME}-live.wasm /out/${RUNTIME}_runtime.compact.wasm | tee /out/${RUNTIME}-diff.txt
64+
- mkdir ./out
65+
- mv /out/* ./out/
66+
cache:
67+
key: cache-wasm
68+
paths:
69+
- /build
70+
- /out
71+
artifacts:
72+
paths:
73+
- out/*.wasm
74+
- out/*.json
75+
- out/*.txt
76+
expire_in: 12 week

.gitlab/check-skip.yml

-15
This file was deleted.

.gitlab/check.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
.check_skip_rust:
2+
before_script:
3+
- |-
4+
if echo "$CI_COMMIT_TITLE" | grep -q "ci-skip-rust"; then
5+
echo "Skipping rust tests due to commit title"
6+
exit 0
7+
fi
8+
9+
.check_skip_integration_tests:
10+
before_script:
11+
- |-
12+
if echo "$CI_COMMIT_TITLE" | grep -q "ci-skip-integration-tests"; then
13+
echo "Skipping integration tests due to commit title"
14+
exit 0
15+
fi
16+
17+
cargo-clippy:
18+
extends: .check_skip_rust
19+
image: paritytech/ci-unified:bullseye-1.77.0
20+
stage: check
21+
variables:
22+
RUSTFLAGS: "-D warnings"
23+
script:
24+
- cargo clippy --all-targets --locked --workspace --quiet
25+
- cargo clippy --all-targets --all-features --locked --workspace --quiet
26+
27+
check-toml-format:
28+
extends: .check_skip_rust
29+
image: paritytech/ci-unified:bullseye-1.77.0
30+
stage: check
31+
cache: {}
32+
script:
33+
- cargo fmt -- --check
34+
- taplo fmt --check

.gitlab/release.yml

-60
This file was deleted.

0 commit comments

Comments
 (0)