diff --git a/.github/actions/setup-try-runtime/action.yml b/.github/actions/setup-try-runtime/action.yml new file mode 100644 index 0000000..d251c2b --- /dev/null +++ b/.github/actions/setup-try-runtime/action.yml @@ -0,0 +1,39 @@ +# Install try-runtime +name: Install try-runtime +description: | + This action sets up the rust toolchain, installs the protoc compiler + dependency, rust-cache and try-runtime. + +runs: + using: "composite" + steps: + - name: Free up space on runner + run: | + sudo rm -rf /usr/share/dotnet + sudo rm -rf /opt/ghc + sudo rm -rf "/usr/local/share/boost" + sudo rm -rf "$AGENT_TOOLSDIRECTORY" + shell: bash + + - name: Rust Setup + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + target: wasm32-unknown-unknown + override: true + components: rustfmt, clippy + + - name: Install protoc + run: sudo apt-get install -y protobuf-compiler && protoc --version + shell: bash + + - name: Rust Cache + uses: Swatinem/rust-cache@v2.5.0 + with: + cache-on-failure: true + cache-all-crates: true + + - name: Install try-runtime + run: cargo install --git https://github.com/paritytech/try-runtime-cli --locked + shell: bash \ No newline at end of file diff --git a/.github/workflows/try-runtime.devnet.yml b/.github/workflows/try-runtime.devnet.yml new file mode 100644 index 0000000..b407293 --- /dev/null +++ b/.github/workflows/try-runtime.devnet.yml @@ -0,0 +1,30 @@ +# Test storage migration using try-runtime on PRs with label "migration-devnet" +name: Test storage migration (devnet) + +on: + pull_request: + types: [labeled, synchronize] + push: + branches: [ main ] + +jobs: + try_runtime: + if: contains(github.event.pull_request.labels.*.name, 'migration-devnet') + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Setup try-runtime + uses: ./.github/actions/setup-try-runtime + + # a live RPC node is required for the below work + - run: | + echo "Found label "migration-devnet". Running tests" + echo "---------- Running try-runtime for devnet extended-parachain-template ----------" + cargo build -p parachain-template-node --locked --release --no-default-features --features try-runtime && \ + try-runtime --runtime ./target/release/wbuild/devnet-runtime/target/wasm32-unknown-unknown/release/devnet_runtime.wasm \ + on-runtime-upgrade live --uri wss://try-runtime-rpc-node.parity.io:443 + env: + RUST_LOG: remote-ext=debug,runtime=debug + diff --git a/.github/workflows/try-runtime.mainnet.yml b/.github/workflows/try-runtime.mainnet.yml new file mode 100644 index 0000000..76ee590 --- /dev/null +++ b/.github/workflows/try-runtime.mainnet.yml @@ -0,0 +1,30 @@ +# Test storage migration using try-runtime on PRs with label "migration-mainnet" +name: Test storage migration (mainnet) + +on: + pull_request: + types: [labeled, synchronize] + push: + branches: [ main ] + +jobs: + try_runtime: + if: contains(github.event.pull_request.labels.*.name, 'migration-mainnet') + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Setup try-runtime + uses: ./.github/actions/setup-try-runtime + + # a live RPC node is required for the below work + - run: | + echo "Found label "migration-mainnet". Running tests" + echo "---------- Running try-runtime for mainnet extended-parachain-template ----------" + cargo build -p parachain-template-node --locked --release --no-default-features --features try-runtime && \ + try-runtime --runtime ./target/release/wbuild/mainnet-runtime/target/wasm32-unknown-unknown/release/mainnet_runtime.wasm \ + on-runtime-upgrade live --uri wss://try-runtime-rpc-node.parity.io:443 + env: + RUST_LOG: remote-ext=debug,runtime=debug +