Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Add srtool + subwasm workflow #462

Merged
merged 11 commits into from
Jun 3, 2021
Merged
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions .github/workflows/srtool.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Srtool build

on: push
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we want to run the workflow on every push?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@s3krit Can we run it on a release? E.g. on certain branch names or tags?

Copy link
Contributor

@s3krit s3krit Jun 3, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep dead simple - if you know the pattern of what cumulus release tags look like, you can match like so: https://github.com/paritytech/polkadot/blob/master/.github/workflows/publish-draft-release.yml#L7

(and swapping tag for branch if you want to react to a particular branch pattern)


jobs:
srtool:
runs-on: ubuntu-latest
strategy:
matrix:
chain: ["statemine"]
chevdor marked this conversation as resolved.
Show resolved Hide resolved
chevdor marked this conversation as resolved.
Show resolved Hide resolved
steps:
- uses: actions/checkout@v2
- name: Srtool build
id: srtool_build
uses: chevdor/srtool-actions@draft
with:
chain: ${{ matrix.chain }}
runtime_dir: polkadot-parachains/${{ matrix.chain }}-runtime
- 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
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.chain }}-runtime-${{ github.sha }}
path: |
${{ steps.srtool_build.outputs.wasm }}
${{ matrix.chain }}-srtool-digest.json
- name: Install subwasm
uses: actions-rs/cargo@v1
with:
command: install
args: "--git https://gitlab.com/chevdor/subwasm"
- 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
run: |
subwasm diff ${{ steps.srtool_build.outputs.wasm }} --chain-b ${{ matrix.chain }} > ${{ matrix.chain }}-diff.txt
cat ${{ matrix.chain }}-diff.txt
- name: Archive Subwasm results
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.chain }}-runtime-${{ github.sha }}
path: |
${{ matrix.chain }}-info.json
${{ matrix.chain }}-metadata.json
${{ matrix.chain }}-diff.txt