This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 379
Add srtool + subwasm workflow #462
Merged
Merged
Changes from 10 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
3334a7c
Add basic srtool workflow
chevdor cf223be
Fix runtime_dir
chevdor 8bf68d8
Store runtime as artifact
chevdor ae69dbc
Fix CI for artifacts
chevdor c48fa43
fix github sha
chevdor 847b7da
Short sha
chevdor 5c42ef0
Add digest to the artifacts
chevdor 8c492da
Add subwasm
chevdor 5527cd3
Revert to longer SHA
chevdor a867aeb
Fix github sha
chevdor 42e80c7
Build also westmint
chevdor File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: Srtool build | ||
|
||
on: push | ||
|
||
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 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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)