Skip to content

Commit

Permalink
replace "use", execute it locally, disable first half for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
BillyWooo committed Jan 15, 2025
1 parent e6df6fe commit 7d52580
Showing 1 changed file with 84 additions and 37 deletions.
121 changes: 84 additions & 37 deletions .github/workflows/check-runtime-upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,39 +55,39 @@ jobs:
TASKS=$(echo $TASKS | jq -c .)
echo "runtime=$TASKS" >> $GITHUB_OUTPUT
simulate-runtime-upgrade:
runs-on: ubuntu-22.04
needs:
- check-condition
- runtime-matrix
if: needs.check-condition.outputs.skip_simulation == 'false'
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
runtime: ${{ fromJSON(needs.runtime-matrix.outputs.runtime) }}
name: ${{ matrix.runtime.name }}
steps:
- name: Checkout codes on ${{ github.ref }}
uses: actions/checkout@v4
with:
fetch-depth: 0
# simulate-runtime-upgrade:
# runs-on: ubuntu-22.04
# needs:
# - check-condition
# - runtime-matrix
# if: needs.check-condition.outputs.skip_simulation == 'false'
# timeout-minutes: 30
# strategy:
# fail-fast: false
# matrix:
# runtime: ${{ fromJSON(needs.runtime-matrix.outputs.runtime) }}
# name: ${{ matrix.runtime.name }}
# steps:
# - name: Checkout codes on ${{ github.ref }}
# uses: actions/checkout@v4
# with:
# fetch-depth: 0

- name: Enable corepack and pnpm
run: corepack enable && corepack enable pnpm
# - name: Enable corepack and pnpm
# run: corepack enable && corepack enable pnpm

- name: Install subwasm ${{ env.SUBWASM_VERSION }}
run: |
wget https://github.com/chevdor/subwasm/releases/download/v${{ env.SUBWASM_VERSION }}/subwasm_linux_amd64_v${{ env.SUBWASM_VERSION }}.deb
sudo dpkg -i subwasm_linux_amd64_v${{ env.SUBWASM_VERSION }}.deb
subwasm --version
- name: Test runtime upgrade
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
timeout-minutes: 10
run: |
./parachain/scripts/runtime-upgrade.sh ${{ matrix.runtime.name }} ${{ matrix.runtime.uri }} ${{ env.RELEASE_TAG }}
# - name: Install subwasm ${{ env.SUBWASM_VERSION }}
# run: |
# wget https://github.com/chevdor/subwasm/releases/download/v${{ env.SUBWASM_VERSION }}/subwasm_linux_amd64_v${{ env.SUBWASM_VERSION }}.deb
# sudo dpkg -i subwasm_linux_amd64_v${{ env.SUBWASM_VERSION }}.deb
# subwasm --version

# - name: Test runtime upgrade
# env:
# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# timeout-minutes: 10
# run: |
# ./parachain/scripts/runtime-upgrade.sh ${{ matrix.runtime.name }} ${{ matrix.runtime.uri }} ${{ env.RELEASE_TAG }}

try-runtime:
runs-on: ubuntu-22.04
Expand All @@ -105,10 +105,57 @@ jobs:
with:
fetch-depth: 0

- name: Run ${{ matrix.runtime.name }} try-runtime check
uses: BillyWooo/try-runtime-gha@v0.3.0
- name: Download try-runtime-cli
run: |
curl -sL https://github.com/paritytech/try-runtime-cli/releases/download/v0.8.0/try-runtime-x86_64-unknown-linux-musl -o try-runtime
chmod +x ./try-runtime
mv try-runtime parachain
shell: bash

- name: Install Protoc
uses: arduino/setup-protoc@v1.3.0
with:
runtime-package: ${{ matrix.runtime.package }}
node-uri: ${{ matrix.runtime.uri }}
checks: "all"
extra-args: ""
version: "3.6.1"

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

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

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

- name: Check migrations
run: |
cd parachain
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
export RUST_LOG=remote-ext=debug,runtime=debug
# Store the command in a variable so we can log it
COMMAND="./try-runtime \
--runtime $RUNTIME_BLOB_PATH \
on-runtime-upgrade --disable-mbm-checks --blocktime 12000000 \
live --uri ${{ matrix.runtime.uri }}"
# Echo the command before running it, for debugging purposes
echo "Running command:"
echo "$COMMAND"
eval "$COMMAND"
shell: bash

# - name: Run ${{ matrix.runtime.name }} try-runtime check
# uses: BillyWooo/try-runtime-gha@v0.3.0
# with:
# runtime-package: ${{ matrix.runtime.package }}
# node-uri: ${{ matrix.runtime.uri }}
# checks: "all"
# extra-args: ""

0 comments on commit 7d52580

Please sign in to comment.