Skip to content
This repository has been archived by the owner on Dec 18, 2024. It is now read-only.

add try-runtime-ci #81

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/actions/setup-try-runtime/action.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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
30 changes: 30 additions & 0 deletions .github/workflows/try-runtime.devnet.yml
Original file line number Diff line number Diff line change
@@ -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

30 changes: 30 additions & 0 deletions .github/workflows/try-runtime.mainnet.yml
Original file line number Diff line number Diff line change
@@ -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