Skip to content

Commit 3c75c8e

Browse files
authored
Prepare a version based on STABLE (#59)
* Remove some more unstable flags * Update to Rust 1.69.0 and latest tooling * Add specific registry to the container image * Fix upload paths for tests * Add quicker test * Fix working folders + better debugging * Fix working directory * Fix matrix for Cumulus * Fix artifact path * Typos
1 parent 965d0a9 commit 3c75c8e

16 files changed

+390
-88
lines changed

.github/workflows/manual-acala.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
name: Manual Build - Acala
22

33
env:
4-
SUBWASM_VERSION: 0.18.0
4+
SUBWASM_VERSION: 0.19.1
55

66
on:
77
workflow_dispatch:
88
inputs:
99
srtool_tag:
1010
description: The SRTOOL tag to use
11-
default: 1.66.1
11+
default: 1.69.0
1212
required: false
1313
ref:
1414
description: The ref to be used for the repo

.github/workflows/manual-cumulus.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
name: Manual Build - Cumulus
22

33
env:
4-
SUBWASM_VERSION: 0.18.0
4+
SUBWASM_VERSION: 0.19.1
55

66
on:
77
workflow_dispatch:
88
inputs:
99
srtool_tag:
1010
description: The SRTOOL tag to use
11-
default: 1.66.1
11+
default: 1.69.0
1212
required: false
1313
ref:
1414
description: The ref to be used for the repo

.github/workflows/manual-moonbeam.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
name: Manual Build - Moonbeam
22

33
env:
4-
SUBWASM_VERSION: 0.18.0
4+
SUBWASM_VERSION: 0.19.1
55

66
on:
77
workflow_dispatch:
88
inputs:
99
srtool_tag:
1010
description: The SRTOOL tag to use
11-
default: 1.66.1
11+
default: 1.69.0
1212
required: false
1313
ref:
1414
description: The ref to be used for the repo

.github/workflows/manual-polkadot.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
name: Manual Build - Polkadot
22

33
env:
4-
SUBWASM_VERSION: 0.18.0
4+
SUBWASM_VERSION: 0.19.1
55

66
on:
77
workflow_dispatch:
88
inputs:
99
srtool_tag:
1010
description: The SRTOOL tag to use
11-
default: 1.66.1
11+
default: 1.69.0
1212
required: false
1313
ref:
1414
description: The ref to be used for the repo

.github/workflows/manual-shiden.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
name: Manual Build - Shiden
22

33
env:
4-
SUBWASM_VERSION: 0.18.0
4+
SUBWASM_VERSION: 0.19.1
55

66
on:
77
workflow_dispatch:
88
inputs:
99
srtool_tag:
1010
description: The SRTOOL tag to use
11-
default: 1.66.1
11+
default: 1.69.0
1212
required: false
1313
ref:
1414
description: The ref to be used for the repo

.github/workflows/manual.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
name: Manual Build
22

33
env:
4-
SUBWASM_VERSION: 0.18.0
4+
SUBWASM_VERSION: 0.19.1
55

66
on:
77
workflow_dispatch:
88
inputs:
99
srtool_tag:
1010
description: The SRTOOL tag to use
11-
default: 1.66.1
11+
default: 1.69.0
1212
required: false
1313
srtool_image:
1414
description: The SRTOOL image to use

.github/workflows/quick-test.yml

Lines changed: 248 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,248 @@
1+
name: Quick Test
2+
on:
3+
push:
4+
branches:
5+
- master
6+
tags:
7+
- "!v*"
8+
9+
pull_request:
10+
11+
workflow_dispatch:
12+
13+
jobs:
14+
build:
15+
name: Build Srtool Docker image
16+
runs-on: ubuntu-latest
17+
continue-on-error: false
18+
steps:
19+
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
20+
with:
21+
ref: ${{ github.event.pull_request.head.sha }}
22+
23+
- name: Build image
24+
run: |
25+
SRTOOL_VERSION=$(cat VERSION)
26+
RUSTC_VERSION=$(cat RUSTC_VERSION)
27+
echo Building tag $RUSTC_VERSION:$SRTOOL_VERSION
28+
echo "SRTOOL_VERSION=$SRTOOL_VERSION" >> $GITHUB_ENV
29+
echo "RUSTC_VERSION=$RUSTC_VERSION" >> $GITHUB_ENV
30+
docker --version
31+
docker build $@ --build-arg RUSTC_VERSION=$RUSTC_VERSION -t srtool .
32+
docker run -t --rm srtool version -cM
33+
34+
- name: Export docker image
35+
run: |
36+
docker save srtool | gzip > srtool.tar.gz
37+
38+
- name: Cache the image
39+
uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7 # v3.0.11
40+
with:
41+
key: srtool-docker-image-${{ github.sha }}
42+
path: |
43+
srtool.tar.gz
44+
45+
common:
46+
runs-on: ubuntu-latest
47+
needs: build
48+
continue-on-error: false
49+
steps:
50+
- name: Cache the image
51+
uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7 # v3.0.11
52+
with:
53+
key: srtool-docker-image-${{ github.sha }}
54+
path: |
55+
srtool.tar.gz
56+
57+
- name: Load Docker image
58+
run: |
59+
docker load -i srtool.tar.gz
60+
docker images --digests
61+
62+
- name: Check the version
63+
run: |
64+
VERSION=$(docker run -t --rm srtool version -cM)
65+
if [[ \
66+
$( echo $VERSION | jq .name -cMr | wc -c ) -le 5 ||
67+
$( echo $VERSION | jq .version -cMr | wc -c ) -le 5 ||
68+
$( echo $VERSION | jq .rustc -cMr | wc -c ) -le 5 \
69+
]] ; then
70+
echo "Invalid version output"
71+
exit 1
72+
else
73+
echo $VERSION
74+
fi
75+
76+
container-structure-test:
77+
runs-on: ubuntu-latest
78+
needs: build
79+
continue-on-error: false
80+
steps:
81+
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
82+
with:
83+
ref: ${{ github.event.pull_request.head.sha }}
84+
85+
- name: Show files
86+
run: |
87+
ls -al
88+
89+
- name: Cache the image
90+
uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7 # v3.0.11
91+
with:
92+
key: srtool-docker-image-${{ github.sha }}
93+
path: |
94+
srtool.tar.gz
95+
96+
- name: Install tooling
97+
run: |
98+
curl -LO https://storage.googleapis.com/container-structure-test/latest/container-structure-test-linux-amd64 && \
99+
chmod +x container-structure-test-linux-amd64 && \
100+
mkdir -p $HOME/bin && \
101+
export PATH=$PATH:$HOME/bin && \
102+
mv container-structure-test-linux-amd64 $HOME/bin/container-structure-test
103+
echo "Installed version:"
104+
container-structure-test version
105+
106+
- name: Load Docker image
107+
run: |
108+
docker load -i srtool.tar.gz
109+
docker images --digests
110+
111+
- name: Run the tests
112+
run: |
113+
export PATH=$PATH:$HOME/bin
114+
TESTS=$(find tests -type f | sed -e 's/^/ --config /g' | tr -d '\n')
115+
echo "Running tests:"
116+
find tests -type f
117+
container-structure-test test --image srtool --verbosity info ${TESTS}
118+
119+
polkadot:
120+
runs-on: ubuntu-latest
121+
needs: build
122+
continue-on-error: false
123+
strategy:
124+
fail-fast: false
125+
matrix:
126+
chain: ["westend"]
127+
steps:
128+
- name: Cache the image
129+
uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7 # v3.0.11
130+
with:
131+
key: srtool-docker-image-${{ github.sha }}
132+
path: |
133+
srtool.tar.gz
134+
135+
- name: Load Docker image
136+
run: |
137+
docker load -i srtool.tar.gz
138+
docker images --digests
139+
140+
- name: Check out the Polkadot repo
141+
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
142+
with:
143+
repository: paritytech/polkadot
144+
ref: ${{ github.event.inputs.ref }}
145+
fetch-depth: 0
146+
path: polkadot
147+
148+
- name: Run srtool info
149+
env:
150+
PACKAGE: ${{ matrix.chain }}-runtime
151+
RUNTIME_DIR: runtime/${{ matrix.chain }}
152+
working-directory: polkadot
153+
run: |
154+
INFO=$(docker run --rm -i \
155+
-e PACKAGE=$PACKAGE \
156+
-e RUNTIME_DIR=$RUNTIME_DIR \
157+
-v "${PWD}":/build \
158+
srtool info -cM)
159+
160+
if [ $( echo $INFO | jq .src -r ) != "git" ] ; then
161+
echo Invalid info output, got $( echo $INFO | jq .src -r )
162+
exit 1
163+
else
164+
echo $INFO
165+
fi
166+
167+
- name: Debug information
168+
env:
169+
PACKAGE: ${{ matrix.chain }}-runtime
170+
RUNTIME_DIR: runtime/${{ matrix.chain }}
171+
working-directory: polkadot
172+
run: |
173+
echo "::group::Runtimes"
174+
ls -al runtime || true
175+
echo "::endgroup::"
176+
177+
echo "::group::${{ matrix.chain }}"
178+
ls -al runtime/${{ matrix.chain }} || true
179+
echo "::endgroup::"
180+
181+
echo "::group::IDs and Docker"
182+
id -u runner || true
183+
id -g runner || true
184+
id -u docker || true
185+
docker info --format "{{ .ClientInfo.Context }}"
186+
echo "::endgroup::"
187+
188+
- name: Run srtool build for ${{ matrix.chain }}
189+
id: srtool_build
190+
env:
191+
PACKAGE: ${{ matrix.chain }}-runtime
192+
RUNTIME_DIR: runtime/${{ matrix.chain }}
193+
working-directory: polkadot
194+
run: |
195+
CMD="docker run --rm -i \
196+
-e PACKAGE=$PACKAGE \
197+
-e RUNTIME_DIR=$RUNTIME_DIR \
198+
-v ${PWD}:/build \
199+
srtool build --app --json"
200+
echo ::debug::build::docker_run $CMD
201+
202+
echo "::group::SRTOOL Build Output"
203+
stdbuf -oL $CMD | {
204+
while IFS= read -r line
205+
do
206+
echo ║ $line
207+
JSON="$line"
208+
done
209+
210+
echo "json=$JSON" >> $GITHUB_OUTPUT
211+
echo "JSON=$JSON" >> $GITHUB_ENV
212+
213+
echo $JSON | jq .
214+
215+
WASM=`echo $JSON | jq -r .runtimes.compact.wasm`
216+
echo "wasm=$WASM" >> $GITHUB_OUTPUT
217+
218+
Z_WASM=`echo $JSON | jq -r .runtimes.compressed.wasm`
219+
echo "wasm_compressed=$Z_WASM" >> $GITHUB_OUTPUT
220+
}
221+
echo "::endgroup::"
222+
223+
- name: Summary for ${{ matrix.chain }}
224+
working-directory: polkadot
225+
run: |
226+
echo "::group::JSON digest"
227+
echo $JSON | jq . | tee ${{ matrix.chain }}-srtool-digest.json
228+
echo "::endgroup::"
229+
230+
echo "::group::Runtimes paths"
231+
echo "Compact Runtime: ${{ steps.srtool_build.outputs.wasm }}"
232+
echo "Compressed Runtime: ${{ steps.srtool_build.outputs.wasm_compressed }}"
233+
echo "::endgroup::"
234+
235+
echo "::group::Debugging"
236+
pwd; ls -al
237+
ls -al ${{ steps.srtool_build.outputs.wasm_compressed }}
238+
ls -al ${{ steps.srtool_build.outputs.wasm_compressed }}
239+
echo "::endgroup::"
240+
241+
- name: Archive Artifacts for ${{ matrix.chain }}
242+
uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0
243+
with:
244+
name: ${{ matrix.chain }}-runtime
245+
path: |
246+
polkadot/${{ steps.srtool_build.outputs.wasm }}
247+
polkadot/${{ steps.srtool_build.outputs.wasm_compressed }}
248+
polkadot/${{ matrix.chain }}-srtool-digest.json

0 commit comments

Comments
 (0)