-
Notifications
You must be signed in to change notification settings - Fork 525
88 lines (76 loc) · 3.03 KB
/
extrinsic-ordering-check-on-release.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
# This workflow performs the Extrinsic Ordering Check on demand using docker images
name: Extrinsic Ordering Check On Release
on:
workflow_call:
inputs:
chain:
description: Chain Runtime
required: true
type: string
workflow_dispatch:
inputs:
chain:
description: Chain Runtime (default = karura)
default: karura
required: true
type: choice
options:
- mandala
- karura
- acala
version:
description: Release version.
required: true
previous_version:
description: Previous release version.
required: true
env:
CHAIN: ${{ github.event.inputs.chain }}
VERSION: ${{ github.event.inputs.version }}
PREVIOUS_VERSION: ${{ github.event.inputs.previous_version }}
jobs:
check-extrinsic-ordering-on-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Setup ENV
if: ${{ env.CHAIN == '' || env.VERSION == '' || env.PREVIOUS_VERSION == '' }}
run: python .github/scripts/extrinsic_check_setup_env.py
- name: Prepare output
run: |
echo "METADATA COMPARISON" >> output.txt
echo "Date: $(date)" >> output.txt
echo "Reference: release-${{ env.CHAIN }}-${{ env.PREVIOUS_VERSION }}" >> output.txt
echo "Target version: release-${{ env.CHAIN }}-${{ env.VERSION }}" >> output.txt
echo "-------------------------------------------" >> output.txt
- name: Start local node
run: |
docker run --name extrinsic-ordering-check-${{ env.CHAIN }}-${{ env.PREVIOUS_VERSION }} -d -p 9944:9944 --rm ghcr.io/acalanetwork/${{ env.CHAIN }}-node:${{ env.PREVIOUS_VERSION }} --chain=${{ env.CHAIN }}-dev --rpc-cors=all --rpc-external --rpc-port=9944 --tmp -- --dev
docker run --name extrinsic-ordering-check-${{ env.CHAIN }}-${{ env.VERSION }} -d -p 9955:9955 --rm ghcr.io/acalanetwork/${{ env.CHAIN }}-node:${{ env.VERSION }} --chain=${{ env.CHAIN }}-dev --rpc-cors=all --rpc-external --rpc-port=9955 --tmp -- --dev
sleep 120
- name: Compare the metadata
run: |
docker run --network=host jacogr/polkadot-js-tools metadata ws://127.0.0.1:9944 ws://127.0.0.1:9955 >> output.txt
sed -z -i 's/\n\n/\n/g' output.txt
- name: Show result
run: cat output.txt
- name: Save output as artifact
uses: actions/upload-artifact@v2
with:
name: ${{ env.CHAIN }}
path: |
output.txt
- name: Stop our local node
if: always()
run: |
docker stop extrinsic-ordering-check-${{ env.CHAIN }}-${{ env.PREVIOUS_VERSION }}
docker stop extrinsic-ordering-check-${{ env.CHAIN }}-${{ env.VERSION }}
- name: Analyze output
run: python .github/scripts/extrinsic_check_analyze.py output.txt