|
| 1 | +# This workflow performs the Extrinsic Ordering Check on demand using a binary |
| 2 | + |
| 3 | +name: Extrinsic Ordering Check from Binary |
| 4 | +on: |
| 5 | + workflow_dispatch: |
| 6 | + inputs: |
| 7 | + reference_url: |
| 8 | + description: The WebSocket url of the reference node |
| 9 | + default: wss://kusama-statemine-rpc.paritytech.net |
| 10 | + required: true |
| 11 | + binary_url: |
| 12 | + description: A url to a Linux binary for the node containing the runtime to test |
| 13 | + default: https://github.com/paritytech/cumulus/releases/download/statemine_v3/polkadot-collator |
| 14 | + required: true |
| 15 | + chain: |
| 16 | + description: The name of the chain under test. Usually, you would pass a local chain |
| 17 | + default: statemine-local |
| 18 | + required: true |
| 19 | + |
| 20 | +jobs: |
| 21 | + check: |
| 22 | + name: Run check |
| 23 | + runs-on: ubuntu-latest |
| 24 | + env: |
| 25 | + CHAIN: ${{github.event.inputs.chain}} |
| 26 | + BIN_URL: ${{github.event.inputs.binary_url}} |
| 27 | + REF_URL: ${{github.event.inputs.reference_url}} |
| 28 | + |
| 29 | + steps: |
| 30 | + - uses: actions/checkout@v2 |
| 31 | + |
| 32 | + - name: Fetch binary |
| 33 | + run: | |
| 34 | + echo Fetching $BIN_URL |
| 35 | + wget $BIN_URL |
| 36 | + chmod a+x polkadot-collator |
| 37 | + ./polkadot-collator --version |
| 38 | +
|
| 39 | + - name: Start local node |
| 40 | + run: | |
| 41 | + echo Running on $CHAIN |
| 42 | + ./polkadot-collator --chain=$CHAIN -- --chain polkadot-local & |
| 43 | +
|
| 44 | + - name: Prepare output |
| 45 | + run: | |
| 46 | + VERSION=$(./polkadot-collator --version) |
| 47 | + echo "Metadata comparison:" >> output.txt |
| 48 | + echo "Date: $(date)" >> output.txt |
| 49 | + echo "Reference: $REF_URL" >> output.txt |
| 50 | + echo "Target version: $VERSION" >> output.txt |
| 51 | + echo "Chain: $CHAIN" >> output.txt |
| 52 | + echo "----------------------------------------------------------------------" >> output.txt |
| 53 | +
|
| 54 | + - name: Pull polkadot-js-tools image |
| 55 | + run: docker pull jacogr/polkadot-js-tools |
| 56 | + |
| 57 | + - name: Compare the metadata |
| 58 | + run: | |
| 59 | + CMD="docker run --pull always --network host jacogr/polkadot-js-tools metadata $REF_URL ws://localhost:9944" |
| 60 | + echo -e "Running:\n$CMD" |
| 61 | + $CMD >> output.txt |
| 62 | + sed -z -i 's/\n\n/\n/g' output.txt |
| 63 | + cat output.txt | egrep -n -i '' |
| 64 | + SUMMARY=$(./scripts/extrinsic-ordering-filter.sh output.txt) |
| 65 | + echo -e $SUMMARY |
| 66 | + echo -e $SUMMARY >> output.txt |
| 67 | +
|
| 68 | + - name: Show result |
| 69 | + run: | |
| 70 | + cat output.txt |
| 71 | +
|
| 72 | + - name: Stop our local node |
| 73 | + run: | |
| 74 | + pkill polkadot-collator |
| 75 | + continue-on-error: true |
| 76 | + |
| 77 | + - name: Save output as artifact |
| 78 | + uses: actions/upload-artifact@v2 |
| 79 | + with: |
| 80 | + name: ${{ env.CHAIN }} |
| 81 | + path: | |
| 82 | + output.txt |
0 commit comments