2323env :
2424 GITHUB_CACHE_VERSION : 0
2525
26- RUST_TOOLCHAIN : nightly
2726 RUST_BACKTRACE : full
2827 RUSTC_WRAPPER : sccache
2928
3029 SCCACHE_LINK : https://github.com/mozilla/sccache/releases/download
3130 SCCACHE_VERSION : v0.3.0
3231 SCCACHE_DIR : /home/runner/.cache/sccache
3332
34- SUBALFRED_LINK : https://github.com/hack-ink/subalfred/releases/latest/download/subalfred-x86_64-unknown-linux-gnu.zst
35-
3633jobs :
3734 basic-checks :
3835 name : Task ${{ matrix.action }} darwinia
4138 strategy :
4239 matrix :
4340 action : [build, test]
44-
4541 steps :
4642 - name : Setup build environment
4743 run : sudo apt install -y protobuf-compiler
48- - name : Install Rust ${{ env.RUST_TOOLCHAIN }} toolchain
49- uses : actions-rs/toolchain@v1
50- with :
51- toolchain : ${{ env.RUST_TOOLCHAIN }}
52- default : true
5344 - name : Install Sccache
5445 run : |
5546 export SCCACHE_FILE=sccache-${{ env.SCCACHE_VERSION }}-x86_64-unknown-linux-musl
@@ -78,17 +69,15 @@ jobs:
7869 with :
7970 command : ${{ matrix.action }}
8071 args : --release --locked --features all-native
81- - name : Compress
72+ - name : Change path
8273 if : matrix.action != 'test'
83- run : |
84- mv target/release/darwinia .
85- tar cf darwinia.tar.zst darwinia -I pzstd
74+ run : mv target/release/darwinia .
8675 - name : Upload
8776 if : matrix.action != 'test'
8877 uses : actions/upload-artifact@v2
8978 with :
9079 name : darwinia
91- path : darwinia.tar.zst
80+ path : darwinia
9281 - name : Shrink cache
9382 run : .github/shrink-cache.sh
9483
@@ -106,75 +95,25 @@ jobs:
10695 path : ${{ matrix.runtime }}
10796
10897 runtime-checks :
109- name : Task check runtime
98+ name : Task check runtimes
11099 if : github.event_name == 'push' || !github.event.pull_request.draft
100+ strategy :
101+ matrix :
102+ target :
103+ [
104+ { chain: darwinia-dev, compare-with: "https://rpc.polkadot.io" },
105+ { chain: crab-dev, compare-with: "https://rpc.polkadot.io" },
106+ { chain: pangolin-dev, compare-with: "https://rpc.polkadot.io" },
107+ ]
111108 needs : [basic-checks]
112109 runs-on : ubuntu-latest
113110 steps :
114- - name : Install Subalfred
115- run : |
116- curl -L ${{ env.SUBALFRED_LINK }} | zstd -o subalfred -d
117- chmod u+x subalfred
118- sudo mv subalfred /usr/bin
119- sudo chmod u+x /usr/bin/subalfred
120- - name : Download darwinia
121- uses : actions/download-artifact@v2
111+ - name : Check ${{ matrix.target.chain }}
112+ uses : hack-ink/subalfred-check-runtime-action@v0.1.8
122113 with :
123- name : darwinia
124- - name : Install darwinia
125- run : |
126- tar xf darwinia.tar.zst -I pzstd
127- sudo mv darwinia /usr/bin
128- - id : check-crab-runtime-version
129- name : Check Crab runtime version
130- run : |
131- OUTPUT=$(subalfred check runtime --executable darwinia --chain crab-dev --live https://rpc.polkadot.io --property version)
132- OUTPUT="${OUTPUT//'%'/'%25'}"
133- OUTPUT="${OUTPUT//$'\n'/'%0A'}"
134- OUTPUT="${OUTPUT//$'\r'/'%0D'}"
135- echo "::set-output name=check-crab-runtime-version::$OUTPUT"
136- - id : check-crab-runtime-storage
137- name : Check Crab runtime storage
138- run : |
139- OUTPUT=$(subalfred check runtime --executable darwinia --chain crab-dev --live https://rpc.polkadot.io --property storage)
140- OUTPUT="${OUTPUT//'%'/'%25'}"
141- OUTPUT="${OUTPUT//$'\n'/'%0A'}"
142- OUTPUT="${OUTPUT//$'\r'/'%0D'}"
143- echo "::set-output name=check-crab-runtime-storage::$OUTPUT"
144- - id : check-darwinia-runtime-version
145- name : Check Darwinia runtime version
146- run : |
147- OUTPUT=$(subalfred check runtime --executable darwinia --chain darwinia-dev --live https://rpc.polkadot.io --property version)
148- OUTPUT="${OUTPUT//'%'/'%25'}"
149- OUTPUT="${OUTPUT//$'\n'/'%0A'}"
150- OUTPUT="${OUTPUT//$'\r'/'%0D'}"
151- echo "::set-output name=check-darwinia-runtime-version::$OUTPUT"
152- - id : check-darwinia-runtime-storage
153- name : Check Darwinia runtime storage
154- run : |
155- OUTPUT=$(subalfred check runtime --executable darwinia --chain darwinia-dev --live https://rpc.polkadot.io --property storage)
156- OUTPUT="${OUTPUT//'%'/'%25'}"
157- OUTPUT="${OUTPUT//$'\n'/'%0A'}"
158- OUTPUT="${OUTPUT//$'\r'/'%0D'}"
159- echo "::set-output name=check-darwinia-runtime-storage::$OUTPUT"
160- - if : github.ref != 'refs/heads/master'
161- uses : marocchino/sticky-pull-request-comment@v2
162- with :
163- append : true
164- message : |
165- <details>
166- <summary>Commit ${{ github.event.pull_request.head.sha }}</summary>
167-
168- **Darwinia**
169- > Check Runtime Version
170- ```diff
171- ${{ steps.check-darwinia-runtime-version.outputs.check-darwinia-runtime-version }}
172- ```
173- > Check Storage Prefix
174- ```diff
175- ${{ steps.check-darwinia-runtime-storage.outputs.check-darwinia-runtime-storage }}
176- ```
177- </details>
114+ uploaded-artifact : darwinia
115+ chain : ${{ matrix.target.chain }}
116+ compare-with : ${{ matrix.target.compare-with }}
178117
179118 checks-cleaning :
180119 name : Task checks cleaning
0 commit comments