Skip to content

hack-ink/subalfred-check-runtime-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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/[email protected]
        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/[email protected]
        with:
          uploaded-artifact: polkadot
          chain: ${{ matrix.target.chain }}
          compare-with: ${{ matrix.target.compare-with }}