/subalfred-check-runtime-action

Use `subalfred check runtime` to check your runtime code.

GNU General Public License v3.0GPL-3.0

Use subalfred check runtime to check your runtime code.

Introduction

This will show the differences between you local runtime and the remote runtime.

Including:

  • storage
  • runtime version

Take a look at the real example here.

Usage

Take Polkadot code/repository as an example.

Requirement.

  1. build your node
  2. upload it
  3. provide a live chain HTTP RPC endpoint to compare with

Build and upload.

jobs:
  basic-checks:
    name: Build and upload Polkadot
    runs-on: ubuntu-latest
    steps:
      - name: Setup build environment
        run: sudo apt install -y protobuf-compiler
      - name: Fetch latest code
        uses: actions/checkout@v3
      - name: Build
        run: |
          cargo build --release --locked
          mv target/release/polkadot .
      - name: Upload
        uses: actions/upload-artifact@v2
        with:
          # pass this name to `uploaded-artifact`
          name: polkadot
          path: polkadot

Check single runtime.

name: Checks
on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main
jobs:
  runtime-checks:
    name: Task check runtime
    needs: [basic-checks]
    runs-on: ubuntu-latest
    steps:
      - name: Check
        uses: actions/subalfred-check-runtime-action@v0.2.1
        with:
          uploaded-artifact: polkadot
          chain: polkadot
          compare-with: https://rpc.polkadot.io

Check multiple runtimes at once.

name: Checks
on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main
jobs:
  runtime-checks:
    name: Task check runtimes
    strategy:
      matrix:
        target: [
            { chain: polkadot-dev, compare-with: https://rpc.polkadot.io },
            { chain: kusama-dev, compare-with: https://kusama-rpc.polkadot.io },
          ]
    needs: [basic-checks]
    runs-on: ubuntu-latest
    steps:
      - name: Check ${{ matrix.target.chain }}
        uses: hack-ink/subalfred-check-runtime-action@v0.2.1
        with:
          uploaded-artifact: polkadot
          chain: ${{ matrix.target.chain }}
          compare-with: ${{ matrix.target.compare-with }}