Skip to content

Commit 5620a09

Browse files
authored
ci: fix contract size submission (#2490)
* ci: fix contract size submission * docs(changelog): add fix along with pr link
1 parent 54bcb34 commit 5620a09

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

.github/workflows/ci.yml

+12-11
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ env:
4242
RISCV_TARGET: .github/riscv64emac-unknown-none-polkavm.json
4343
# Clippy doesn't support JSON files for `--target`, hence we use another RISC-V target.
4444
CLIPPY_TARGET: riscv64imac-unknown-none-elf
45+
# ID used for measurements: non-`master` branches may contain '/' which is problematic for file names
46+
MEASUREMENTS_ID: ${{ github.ref == 'refs/heads/master' && 'master' || github.run_id }}
4547

4648
concurrency:
4749
# Cancel in-progress jobs triggered only on pull_requests
@@ -710,12 +712,11 @@ jobs:
710712
env:
711713
RUSTC_BOOTSTRAP: 1
712714
MANIFEST_PATH: ""
713-
# `github.run_id` used as the branch name may contain '/'
714-
CONTRACT_SIZE_FILE: "measurements-${{ github.run_id }}/contract_size_"
715+
CONTRACT_SIZE_FILE: "measurements-${{ env.MEASUREMENTS_ID }}/contract_size_"
715716
CARGO_INCREMENTAL: 0
716717
with:
717718
command: |
718-
mkdir -p measurements-${{ github.run_id }}/
719+
mkdir -p measurements-${{ env.MEASUREMENTS_ID }}/
719720
scripts/for_all_contracts_exec2.sh --path integration-tests -- \
720721
scripts/build_and_determine_contract_size.sh {}
721722
@@ -724,7 +725,7 @@ jobs:
724725

725726
- uses: actions/upload-artifact@v4
726727
with:
727-
path: ./measurements-${{ github.run_id }}/*
728+
path: ./measurements-${{ env.MEASUREMENTS_ID }}/*
728729
name: ${{ github.run_id }}_artifact
729730
retention-days: 1
730731

@@ -746,13 +747,13 @@ jobs:
746747
run: |
747748
cat downloaded_artifacts/${{github.run_id}}_artifact/* | \
748749
sed -e 's/^integration-tests\/\(public\/\|internal\/\)\?//' | \
749-
sort | uniq > measurements-${{ github.run_id }}
750-
cat measurements-${{ github.run_id }}
750+
sort | uniq > measurements-${{ env.MEASUREMENTS_ID }}
751+
cat measurements-${{ env.MEASUREMENTS_ID }}
751752
752753
- uses: actions/upload-artifact@v4
753754
with:
754-
name: measurements-${{ github.run_id }}
755-
path: ./measurements-${{ github.run_id }}
755+
name: measurements-${{ env.MEASUREMENTS_ID }}
756+
path: ./measurements-${{ env.MEASUREMENTS_ID }}
756757
retention-days: 31
757758

758759
examples-docs:
@@ -908,7 +909,7 @@ jobs:
908909
- name: Download artifact from this branch
909910
uses: dawidd6/action-download-artifact@v9
910911
with:
911-
name: measurements-${{ github.run_id }}
912+
name: measurements-${{ env.MEASUREMENTS_ID }}
912913
run_id: ${{ github.run_id }}
913914

914915
- name: Download master artifact
@@ -924,9 +925,9 @@ jobs:
924925
echo "master:"
925926
cat measurements-master
926927
echo "branch:"
927-
cat measurements-${{ github.run_id }}
928+
cat measurements-${{ env.MEASUREMENTS_ID }}
928929
echo "---"
929-
./scripts/contract_sizes_diff.sh measurements-master measurements-${{ github.run_id }} > contract_sizes_diff.md
930+
./scripts/contract_sizes_diff.sh measurements-master measurements-${{ env.MEASUREMENTS_ID }} > contract_sizes_diff.md
930931
cat contract_sizes_diff.md
931932
932933
- name: Submit Comment

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ You can find binary releases of the node [here](https://github.com/use-ink/ink-n
229229
- Always use ink! ABI/ SCALE codec for constructor and instantiation related builders and utilities - [#2474](https://github.com/use-ink/ink/pull/2474)
230230
- Get rid of "extrinsic for call failed: Pallet error: Revive::AccountAlreadyMapped" - [2483](https://github.com/use-ink/ink/pull/2483)
231231
- CI disk usage via standardised toolchains: `stable` 1.86, `nightly` 2025-02-20 - [#2484](https://github.com/use-ink/ink/pull/2484)
232+
- CI contract size submission - [#2490](https://github.com/use-ink/ink/pull/2490)
232233

233234
## Version 5.1.0
234235

0 commit comments

Comments
 (0)