Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use try-runtime-gha in CI #243

Merged
merged 10 commits into from
Mar 27, 2024
46 changes: 10 additions & 36 deletions .github/workflows/check-migrations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,38 +47,8 @@ jobs:
- name: Checkout sources
uses: actions/checkout@v3

- name: Download try-runtime-cli
- name: Build EXTRA_ARGS
run: |
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

- name: Install Protoc
uses: arduino/setup-protoc@149f6c87b92550901b26acd1632e11c3662e381f # v1.3.0
with:
version: "3.6.1"
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Add wasm32-unknown-unknown target
run: rustup target add wasm32-unknown-unknown

- name: Add rust-src component
run: rustup component add rust-src

- name: Fetch cache
uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2.7.0
with:
shared-key: "fellowship-cache-migrations"

- name: Build ${{ matrix.runtime.name }}
run: |
cargo build --profile production -p ${{ matrix.runtime.package }} --features try-runtime -q --locked

- name: Check migrations
run: |
PACKAGE_NAME=${{ matrix.runtime.package }}
RUNTIME_BLOB_NAME=$(echo $PACKAGE_NAME | sed 's/-/_/g').compact.compressed.wasm
RUNTIME_BLOB_PATH=./target/production/wbuild/$PACKAGE_NAME/$RUNTIME_BLOB_NAME

# When running on relay, we don't need weight checks.
EXTRA_FLAGS=""
if [[ "${{ matrix.runtime.is_relay }}" == "true" ]]; then
Expand All @@ -98,8 +68,12 @@ jobs:

echo "Flags: $EXTRA_FLAGS"

RUST_LOG=runtime=DEBUG ./try-runtime \
--runtime $RUNTIME_BLOB_PATH \
on-runtime-upgrade --checks=pre-and-post \
$EXTRA_FLAGS \
live --uri ${{ matrix.runtime.uri }}
echo "EXTRA_ARGS=$EXTRA_FLAGS" >> $GITHUB_ENV

- name: Run ${{ matrix.runtime.name }} Runtime Checks
uses: "paritytech/[email protected]"
with:
runtime-package: ${{ matrix.runtime.package }}
node-uri: ${{ matrix.runtime.uri }}
checks: "pre-and-post"
extra-args: ${{ env.EXTRA_ARGS }}
Loading