Skip to content

Commit

Permalink
[ci] Move check-runtime-migration to GHA (#5519)
Browse files Browse the repository at this point in the history
PR moves rococo and wococo check-runtime-migration jobs to GHA

cc paritytech/ci_cd#1006
  • Loading branch information
alvicsam authored Aug 29, 2024
1 parent 61bfcb8 commit f7504ce
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 77 deletions.
57 changes: 39 additions & 18 deletions .github/workflows/check-runtime-migration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
types: [opened, synchronize, reopened, ready_for_review]
# Take a snapshot at 5am when most SDK devs are not working.
schedule:
- cron: '0 5 * * *'
- cron: "0 5 * * *"
merge_group:
workflow_dispatch:

Expand All @@ -24,14 +24,25 @@ jobs:
runs-on: ubuntu-latest
outputs:
IMAGE: ${{ steps.set_image.outputs.IMAGE }}
RUNNER: ${{ steps.set_runner.outputs.RUNNER }}
steps:
- name: Checkout
uses: actions/checkout@v4
- id: set_image
run: cat .github/env >> $GITHUB_OUTPUT
# rococo and westend are disabled for now (no access to parity-chains.parity.io)
# By default we use spot machines that can be terminated at any time.
# Merge queues use persistent runners to avoid kicking off from queue when the runner is terminated.
- id: set_runner
run: |
# Run merge queues on persistent runners
if [[ $GITHUB_REF_NAME == *"gh-readonly-queue"* ]]; then
echo "RUNNER=arc-runners-polkadot-sdk-beefy-persistent" >> $GITHUB_OUTPUT
else
echo "RUNNER=arc-runners-polkadot-sdk-beefy" >> $GITHUB_OUTPUT
fi
# More info can be found here: https://github.com/paritytech/polkadot/pull/5865
check-runtime-migration:
runs-on: arc-runners-polkadot-sdk-beefy
runs-on: ${{ needs.set-image.outputs.RUNNER }}
# We need to set this to rather long to allow the snapshot to be created, but the average time
# should be much lower.
timeout-minutes: 60
Expand All @@ -41,9 +52,10 @@ jobs:
strategy:
fail-fast: false
matrix:
network: [
# westend,
# rococo,
network:
[
westend,
rococo,
asset-hub-westend,
asset-hub-rococo,
bridge-hub-westend,
Expand All @@ -53,18 +65,18 @@ jobs:
coretime-rococo,
]
include:
# - network: westend
# package: westend-runtime
# wasm: westend_runtime.compact.compressed.wasm
# uri: "wss://try-runtime-westend.polkadot.io:443"
# subcommand_extra_args: "--no-weight-warnings"
# command_extra_args: ""
# - network: rococo
# package: rococo-runtime
# wasm: rococo_runtime.compact.compressed.wasm
# uri: "wss://try-runtime-rococo.polkadot.io:443"
# subcommand_extra_args: "--no-weight-warnings"
# command_extra_args: ""
- network: westend
package: westend-runtime
wasm: westend_runtime.compact.compressed.wasm
uri: "wss://try-runtime-westend.polkadot.io:443"
subcommand_extra_args: "--no-weight-warnings"
command_extra_args: ""
- network: rococo
package: rococo-runtime
wasm: rococo_runtime.compact.compressed.wasm
uri: "wss://try-runtime-rococo.polkadot.io:443"
subcommand_extra_args: "--no-weight-warnings"
command_extra_args: ""
- network: asset-hub-westend
package: asset-hub-westend-runtime
wasm: asset_hub_westend_runtime.compact.compressed.wasm
Expand Down Expand Up @@ -143,3 +155,12 @@ jobs:
--runtime ./target/release/wbuild/${{ matrix.package }}/${{ matrix.wasm }} \
on-runtime-upgrade --disable-spec-version-check --checks=all ${{ matrix.subcommand_extra_args }} snap -p snapshot.raw
sleep 5
# name of this job must be unique across all workflows
# otherwise GitHub will mark all these jobs as required
confirm-required-checks-passed:
runs-on: ubuntu-latest
name: All runtime migrations passed
# If any new job gets added, be sure to add it to this array
needs: [check-runtime-migration]
steps:
- run: echo '### Good job! All the checks passed 🚀' >> $GITHUB_STEP_SUMMARY
10 changes: 0 additions & 10 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -374,13 +374,3 @@ cancel-pipeline-build-short-benchmark:
extends: .cancel-pipeline-template
needs:
- job: build-short-benchmark

cancel-pipeline-check-runtime-migration-rococo:
extends: .cancel-pipeline-template
needs:
- job: check-runtime-migration-rococo

cancel-pipeline-check-runtime-migration-westend:
extends: .cancel-pipeline-template
needs:
- job: check-runtime-migration-westend
49 changes: 0 additions & 49 deletions .gitlab/pipeline/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,52 +46,3 @@ check-toml-format:
script:
- taplo format --check --config .config/taplo.toml
- echo "Please run `taplo format --config .config/taplo.toml` to fix any toml formatting issues"

# More info can be found here: https://github.com/paritytech/polkadot/pull/5865
.check-runtime-migration:
stage: check
extends:
- .docker-env
- .test-pr-refs
script:
- export RUST_LOG=remote-ext=debug,runtime=debug
- echo "---------- Downloading try-runtime CLI ----------"
- curl -sL https://github.com/paritytech/try-runtime-cli/releases/download/v0.5.4/try-runtime-x86_64-unknown-linux-musl -o try-runtime
- chmod +x ./try-runtime
- echo "Using try-runtime-cli version:"
- ./try-runtime --version
- echo "---------- Building ${PACKAGE} runtime ----------"
- time cargo build --release --locked -p "$PACKAGE" --features try-runtime
- echo "---------- Executing on-runtime-upgrade for ${NETWORK} ----------"
- >
time ./try-runtime ${COMMAND_EXTRA_ARGS} \
--runtime ./target/release/wbuild/"$PACKAGE"/"$WASM" \
on-runtime-upgrade --disable-spec-version-check --checks=all ${SUBCOMMAND_EXTRA_ARGS} live --uri ${URI}
- sleep 5

# Check runtime migrations for Parity managed relay chains
check-runtime-migration-westend:
stage: check
extends:
- .docker-env
- .test-pr-refs
- .check-runtime-migration
variables:
NETWORK: "westend"
PACKAGE: "westend-runtime"
WASM: "westend_runtime.compact.compressed.wasm"
URI: "wss://try-runtime-westend.polkadot.io:443"
SUBCOMMAND_EXTRA_ARGS: "--no-weight-warnings"

check-runtime-migration-rococo:
stage: check
extends:
- .docker-env
- .test-pr-refs
- .check-runtime-migration
variables:
NETWORK: "rococo"
PACKAGE: "rococo-runtime"
WASM: "rococo_runtime.compact.compressed.wasm"
URI: "wss://try-runtime-rococo.polkadot.io:443"
SUBCOMMAND_EXTRA_ARGS: "--no-weight-warnings"

0 comments on commit f7504ce

Please sign in to comment.