From c5b7b1f17146fcea5b0aa6c68f3bb7b792702730 Mon Sep 17 00:00:00 2001 From: Wilfried Kopp Date: Mon, 28 Jun 2021 15:21:22 +0200 Subject: [PATCH] ci: install subwasm from binary --- .github/workflows/srtool.yml | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/.github/workflows/srtool.yml b/.github/workflows/srtool.yml index c19bcce6c223..7321cb40f4f0 100644 --- a/.github/workflows/srtool.yml +++ b/.github/workflows/srtool.yml @@ -23,51 +23,63 @@ jobs: matrix: chain: ["statemine", "westmint", "statemint", "rococo", "shell"] steps: - - name: Get Timestamp - run: echo "TMSP=$(date '+%Y%m%d_%H%M%S')" >> $GITHUB_ENV - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Srtool build id: srtool_build uses: chevdor/srtool-actions@v0.1.0 with: chain: ${{ matrix.chain }} runtime_dir: polkadot-parachains/${{ matrix.chain }} + - name: Summary run: | echo '${{ steps.srtool_build.outputs.json }}' | jq > ${{ matrix.chain }}-srtool-digest.json cat ${{ matrix.chain }}-srtool-digest.json echo "Runtime location: ${{ steps.srtool_build.outputs.wasm }}" - - name: Archive Runtime + + # it takes a while to build the runtime, so let's save the artifact as soon as we have it + - name: Archive Artifacts for ${{ matrix.chain }} uses: actions/upload-artifact@v2 with: - name: ${{ matrix.chain }}-runtime-${{ env.TMSP }}-${{ github.sha }} + name: ${{ matrix.chain }}-runtime path: | ${{ steps.srtool_build.outputs.wasm }} ${{ matrix.chain }}-srtool-digest.json + + # We now get extra information thanks to subwasm - name: Install subwasm run: | - wget https://github.com/chevdor/subwasm/releases/download/v0.11.0/subwasm_linux_amd64.deb - dpkg -i subwasm_linux_amd64.deb + wget https://github.com/chevdor/subwasm/releases/download/v0.11.0/subwasm_linux_amd64_v0.11.0.deb + sudo dpkg -i subwasm_linux_amd64_v0.11.0.deb subwasm --version + - name: Show Runtime information shell: bash run: | subwasm info ${{ steps.srtool_build.outputs.wasm }} subwasm --json info ${{ steps.srtool_build.outputs.wasm }} > ${{ matrix.chain }}-info.json + - name: Extract the metadata shell: bash run: | subwasm meta ${{ steps.srtool_build.outputs.wasm }} subwasm --json meta ${{ steps.srtool_build.outputs.wasm }} > ${{ matrix.chain }}-metadata.json + - name: Check the metadata diff shell: bash + if: startsWith(matrix.chain, 'macOS') + # the following subwasm call will error for chains that are not known and/or live, that includes shell for instance run: | - subwasm diff ${{ steps.srtool_build.outputs.wasm }} --chain-b ${{ matrix.chain }} > ${{ matrix.chain }}-diff.txt - cat ${{ matrix.chain }}-diff.txt + subwasm diff ${{ steps.srtool_build.outputs.wasm }} --chain-b ${{ matrix.chain }} \ + || echo "Subwasm call failed, check the logs. This is likely because ${{ matrix.chain }} is not known by subwasm" | tee ${{ matrix.chain }}-diff.txt + - name: Archive Subwasm results uses: actions/upload-artifact@v2 with: - name: ${{ matrix.chain }}-runtime-${{ env.TMSP }}-${{ github.sha }} + name: ${{ matrix.chain }}-runtime path: | ${{ matrix.chain }}-info.json ${{ matrix.chain }}-metadata.json