This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 379
120 lines (106 loc) · 4.16 KB
/
release-21_extrinsic-ordering-check-from-two.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# This workflow performs the Extrinsic Ordering Check on demand using two reference binaries
name: Release - Extrinsic API Check with reference bins
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/cumulus/v0.9.230/polkadot-parachain
required: true
binary_url:
description: A url to a Linux binary for the node containing the runtime to test
default: https://releases.parity.io/cumulus/v0.9.270-rc7/polkadot-parachain
required: true
jobs:
check:
name: Run check
runs-on: ubuntu-latest
timeout-minutes: 10
env:
REF_URL: ${{github.event.inputs.reference_binary_url}}
BIN_REF: polkadot-parachain-ref
BIN_URL: ${{github.event.inputs.binary_url}}
BIN_BASE: polkadot-parachain
TMP: ./tmp
strategy:
fail-fast: false
matrix:
include:
- runtime: asset-hub-kusama
local: asset-hub-kusama-local
relay: kusama-local
- runtime: asset-hub-polkadot
local: asset-hub-polkadot-local
relay: polkadot-local
- runtime: asset-hub-westend
local: asset-hub-westend-local
relay: polkadot-local
- runtime: contracts-rococo
local: contracts-rococo-local
relay: polkadot-local
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Create tmp dir
run: |
mkdir -p $TMP
pwd
- name: Fetch reference binary for ${{ matrix.runtime }}
run: |
echo Fetching $REF_URL
curl $REF_URL -o $TMP/$BIN_REF
chmod a+x $TMP/$BIN_REF
$TMP/$BIN_REF --version
- name: Fetch test binary for ${{ matrix.runtime }}
run: |
echo Fetching $BIN_URL
curl $BIN_URL -o $TMP/$BIN_BASE
chmod a+x $TMP/$BIN_BASE
$TMP/$BIN_BASE --version
- name: Start local reference node for ${{ matrix.runtime }}
run: |
echo Running reference on ${{ matrix.local }}
$TMP/$BIN_REF --chain=${{ matrix.local }} --ws-port=9954 --tmp -- --chain ${{ matrix.relay }} &
sleep 15
- name: Start local test node for ${{ matrix.runtime }}
run: |
echo Running test on ${{ matrix.local }}
$TMP/$BIN_BASE --chain=${{ matrix.local }} --ws-port=9944 --tmp -- --chain ${{ matrix.relay }} &
sleep 15
- name: Prepare output
run: |
REF_VERSION=$($TMP/$BIN_REF --version)
BIN_VERSION=$($TMP/$BIN_BASE --version)
echo "Metadata comparison:" >> output.txt
echo "Date: $(date)" >> output.txt
echo "Ref. binary: $REF_URL" >> output.txt
echo "Test binary: $BIN_URL" >> output.txt
echo "Ref. version: $REF_VERSION" >> output.txt
echo "Test version: $BIN_VERSION" >> output.txt
echo "Chain: ${{ matrix.local }}" >> output.txt
echo "Relay: ${{ matrix.relay }}" >> 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:9954 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: Save output as artifact
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: ${{ matrix.runtime }}
path: |
output.txt
- name: Stop our local nodes
run: |
pkill $BIN_REF || true
pkill $BIN_BASE || true