Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Changes from 2 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# This workflow performs the Extrinsic Ordering Check on demand using a binary

name: Release - Extrinsic Ordering Check against alternative binary
on:
workflow_dispatch:
inputs:
reference_binary_url:
description: A url to a Linux binary for the node containing the reference runtime to test against
default: https://releases.parity.io/polkadot/x86_64-debian:stretch/v0.9.26/polkadot
required: true
binary_url:
description: A url to a Linux binary for the node containing the runtime to test
default: https://releases.parity.io/polkadot/x86_64-debian:stretch/v0.9.27-rc1/polkadot
required: true
chain:
description: The name of the chain under test. Usually, you would pass a local chain
default: kusama-local
required: true

jobs:
check:
name: Run check
runs-on: ubuntu-latest
env:
CHAIN: ${{github.event.inputs.chain}}
BIN_URL: ${{github.event.inputs.binary_url}}
REF_URL: ${{github.event.inputs.reference_binary_url}}

steps:
- name: Checkout sources
uses: actions/checkout@v3

- name: Fetch reference binary
run: |
echo Fetching $REF_URL
wget $REF_URL
mv polkadot polkadot-ref
chmod a+x polkadot-ref
./polkadot-ref --version

- name: Fetch binary
run: |
echo Fetching $BIN_URL
wget $BIN_URL
chmod a+x polkadot
./polkadot --version

- name: Start local reference node
run: |
echo Running reference on $CHAIN
./polkadot-ref --chain=$CHAIN --rpc-port=9934 --ws-port=9945 &

- name: Start local test node
run: |
echo Running test on $CHAIN
./polkadot --chain=$CHAIN &

- name: Prepare output
run: |
VERSION=$(./polkadot --version)
echo "Metadata comparison:" >> output.txt
echo "Date: $(date)" >> output.txt
echo "Reference: $REF_URL" >> output.txt
echo "Target version: $VERSION" >> output.txt
echo "Chain: $CHAIN" >> output.txt
echo "----------------------------------------------------------------------" >> output.txt

- name: Pull polkadot-js-tools image
run: docker pull jacogr/polkadot-js-tools

- name: Compare the metadata
run: |
CMD="docker run --pull always --network host jacogr/polkadot-js-tools metadata ws://localhost:9945 ws://localhost:9944"
echo -e "Running:\n$CMD"
$CMD >> output.txt
sed -z -i 's/\n\n/\n/g' output.txt
cat output.txt | egrep -n -i ''
SUMMARY=$(./scripts/ci/github/extrinsic-ordering-filter.sh output.txt)
echo -e $SUMMARY
echo -e $SUMMARY >> output.txt

- name: Show result
run: |
cat output.txt

- name: Stop our local nodes
run: |
pkill polkadot-ref
pkill polkadot

- name: Save output as artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.CHAIN }}
path: |
output.txt