Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into ci-enhancements
Browse files Browse the repository at this point in the history
  • Loading branch information
gpmayorga committed Jul 23, 2024
2 parents 1e74672 + 59f0d5d commit 9480a4f
Show file tree
Hide file tree
Showing 23 changed files with 1,482 additions and 1,619 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/build-wasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@ jobs:
# ubuntu-latest 50 min
# ubuntu-latest-4-cores 34 min
runs-on: ubuntu-latest-4-cores
runs-on: ubuntu-latest-4-cores
strategy:
matrix:
chain: [ altair, centrifuge, development ]
name: build-runtime-${{ matrix.chain }}
env:
SRTOOL_IMAGE: "paritytech/srtool:1.77.0-0.15.0"
steps:
# PREP
# PREP
- name: Check out code
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b #4.1.4
Expand All @@ -43,12 +45,14 @@ jobs:
./target/srtool
cache-directories: ./runtime

# Use this to debug what's going on inside the srtool container
# Use this to debug what's going on inside the srtool container
# - name: Run Docker SRTool
# uses: addnab/docker-run-action@4f65fabd2431ebc8d299f8e5a018d79a769ae185 #v3
# with:
# image: paritytech/srtool:${{ matrix.rust_version }}
# options: --user root -v /home/runner/.cargo:/cargo-home -v ${{ github.workspace }}:/build -e BUILD_OPTS=${{ env.BUILD_OPTS || ''}} -e PACKAGE=${{ matrix.chain }}-runtime
# options: --user root -v /home/runner/.cargo:/cargo-home -v ${{ github.workspace }}:/build -e BUILD_OPTS=${{ env.BUILD_OPTS || ''}} -e PACKAGE=${{ matrix.chain }}-runtime
# run: |
# echo "---- Env VARS ----"
# echo "BUILD_OPT=${BUILD_OPT}"
Expand Down Expand Up @@ -143,6 +147,11 @@ jobs:
run: |
## Publish WASM and JSON summary
echo '${{ steps.srtool_build.outputs.json }}' | jq . > "${{ matrix.chain }}-srtool-digest.json"
gsutil cp \
"${{ steps.srtool_build.outputs.wasm }}" \
"gs://centrifuge-wasm-repo/${{ matrix.chain }}/${{ matrix.chain }}-$(git rev-parse --short HEAD).wasm"
## Publish WASM and JSON summary
echo '${{ steps.srtool_build.outputs.json }}' | jq . > "${{ matrix.chain }}-srtool-digest.json"
gsutil cp \
"${{ steps.srtool_build.outputs.wasm }}" \
"gs://centrifuge-wasm-repo/${{ matrix.chain }}/${{ matrix.chain }}-$(git rev-parse --short HEAD).wasm"
Expand All @@ -166,4 +175,24 @@ jobs:
omitNameDuringUpdate: true
omitPrereleaseDuringUpdate: true
# updateOnlyUnreleased: true # When allowUpdates is enabled, this will fail the action if the release it is updating is not a draft or a prerelease.

"${{ matrix.chain }}-srtool-digest.json" \
"gs://centrifuge-wasm-repo/${{ matrix.chain }}/${{ matrix.chain }}-$(git rev-parse --short HEAD)-srtool-digest.json"

- name: Upload WASM to release tag ${{ github.ref_name }}
uses: ncipollo/release-action@a2e71bdd4e7dab70ca26a852f29600c98b33153e # @v1
if: github.event_name == 'release'
# https://github.com/ncipollo/release-action
with:
tag: ${{ github.ref_name }}
commit: ${{ github.sha }}
artifacts: "${{ steps.srtool_build.outputs.wasm }}, ${{ matrix.chain }}-srtool-digest.json"
replacesArtifacts: true
allowUpdates: true
artifactErrorsFailBuild: true
omitBodyDuringUpdate: true
omitDraftDuringUpdate: true
omitNameDuringUpdate: true
omitPrereleaseDuringUpdate: true
# updateOnlyUnreleased: true # When allowUpdates is enabled, this will fail the action if the release it is updating is not a draft or a prerelease.

4 changes: 3 additions & 1 deletion .github/workflows/sanity-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ permissions:
contents: read
jobs:
test-n-lint:
if: ${{ !github.event.pull_request.draft }}
timeout-minutes: 90
name: ${{ matrix.target }}
runs-on: ubuntu-latest-8-cores
Expand Down Expand Up @@ -41,12 +42,13 @@ jobs:
RUSTC_WRAPPER: "sccache"

benchmark-check:
if: ${{ !github.event.pull_request.draft }}
# timeout-minutes: 90 # <- Not needed as ubunt-latest is free of charge
name: bench-check-${{ matrix.runtime }}
runs-on: ubuntu-latest #-4-cores
strategy:
matrix:
runtime: [ altair, centrifuge ]
runtime: [ centrifuge ]
steps:
- name: Check out code
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b #4.1.4
Expand Down
Loading

0 comments on commit 9480a4f

Please sign in to comment.