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 3 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
19 changes: 19 additions & 0 deletions .github/templates/setup-worker/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: setup-worker
description: |
This action sets up a worker for use in other actions. It installs the
necessary dependencies for building the project.

runs:
using: "composite"

steps:
- name: Setup Ubuntu dependencies
shell: bash
run: sudo apt update && sudo apt install -y git clang curl libssl-dev llvm libudev-dev cmake protobuf-compiler

- name: Install Rust stable
shell: bash
run: |
rustup toolchain install stable --profile minimal --component rustfmt
rustup default stable
rustup target add wasm32-unknown-unknown
45 changes: 45 additions & 0 deletions .github/workflows/try-runtime-devnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Test storage migration using try-runtime on PRs with label "migration-devnet"
name: Test storage migration for 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: Check out the repo
uses: actions/checkout@v4

- name: Setup worker
uses: "./.github/templates/setup-worker"

- name: Cache Build artefacts
uses: actions/cache/restore@v3
id: cargo-cache
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-release-${{ env.POLKA_VERSION }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-release-${{ env.POLKA_VERSION }}

- name: Install try-runtime
run: cargo install --git https://github.com/paritytech/try-runtime-cli --locked

# a live RPC node is required for the below work
- run: |
echo "Found label migration. Running tests"
brunopgalvao marked this conversation as resolved.
Show resolved Hide resolved
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://dev-try-runtime-rpc-node.parity.io:443
env:
RUST_LOG: remote-ext=debug,runtime=debug
45 changes: 45 additions & 0 deletions .github/workflows/try-runtime-mainnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Test storage migration using try-runtime on PRs with label "migration-mainnet"
name: Test storage migration for 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: Check out the repo
uses: actions/checkout@v4

- name: Setup worker
uses: "./.github/templates/setup-worker"

- name: Cache Build artefacts
uses: actions/cache/restore@v3
id: cargo-cache
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-release-${{ env.POLKA_VERSION }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-release-${{ env.POLKA_VERSION }}

- name: Install try-runtime
run: cargo install --git https://github.com/paritytech/try-runtime-cli --locked

# a live RPC node is required for the below work
- run: |
echo "Found label migration. Running tests"
brunopgalvao marked this conversation as resolved.
Show resolved Hide resolved
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