@@ -139,7 +139,7 @@ jobs:
139
139
fetch-depth : 1
140
140
141
141
- name : Cache
142
- uses : Swatinem/rust-cache@f0deed1e0edfc6a9be95417288c0e1099b1eeec3 # v2.7.7
142
+ uses : Swatinem/rust-cache@v2
143
143
with :
144
144
cache-directories : ${{ env.CARGO_TARGET_DIR }}
145
145
cache-all-crates : true
@@ -174,7 +174,7 @@ jobs:
174
174
fetch-depth : 1
175
175
176
176
- name : Cache
177
- uses : Swatinem/rust-cache@f0deed1e0edfc6a9be95417288c0e1099b1eeec3 # v2.7.7
177
+ uses : Swatinem/rust-cache@v2
178
178
with :
179
179
cache-directories : ${{ env.CARGO_TARGET_DIR }}
180
180
cache-all-crates : true
@@ -213,7 +213,7 @@ jobs:
213
213
fetch-depth : 1
214
214
215
215
- name : Cache
216
- uses : Swatinem/rust-cache@f0deed1e0edfc6a9be95417288c0e1099b1eeec3 # v2.7.7
216
+ uses : Swatinem/rust-cache@v2
217
217
with :
218
218
cache-directories : ${{ env.CARGO_TARGET_DIR }}
219
219
cache-all-crates : true
@@ -253,7 +253,7 @@ jobs:
253
253
fetch-depth : 1
254
254
255
255
- name : Cache
256
- uses : Swatinem/rust-cache@f0deed1e0edfc6a9be95417288c0e1099b1eeec3 # v2.7.7
256
+ uses : Swatinem/rust-cache@v2
257
257
with :
258
258
cache-directories : ${{ env.CARGO_TARGET_DIR }}
259
259
cache-all-crates : true
@@ -295,7 +295,7 @@ jobs:
295
295
fetch-depth : 1
296
296
297
297
- name : Cache
298
- uses : Swatinem/rust-cache@f0deed1e0edfc6a9be95417288c0e1099b1eeec3 # v2.7.7
298
+ uses : Swatinem/rust-cache@v2
299
299
with :
300
300
cache-directories : ${{ env.CARGO_TARGET_DIR }}
301
301
cache-all-crates : true
@@ -332,7 +332,7 @@ jobs:
332
332
fetch-depth : 1
333
333
334
334
- name : Cache
335
- uses : Swatinem/rust-cache@f0deed1e0edfc6a9be95417288c0e1099b1eeec3 # v2.7.7
335
+ uses : Swatinem/rust-cache@v2
336
336
with :
337
337
cache-directories : ${{ env.CARGO_TARGET_DIR }}
338
338
cache-all-crates : true
@@ -371,7 +371,7 @@ jobs:
371
371
fetch-depth : 1
372
372
373
373
- name : Cache
374
- uses : Swatinem/rust-cache@f0deed1e0edfc6a9be95417288c0e1099b1eeec3 # v2.7.7
374
+ uses : Swatinem/rust-cache@v2
375
375
with :
376
376
cache-directories : ${{ env.CARGO_TARGET_DIR }}
377
377
cache-all-crates : true
@@ -421,7 +421,7 @@ jobs:
421
421
fetch-depth : 1
422
422
423
423
- name : Cache
424
- uses : Swatinem/rust-cache@f0deed1e0edfc6a9be95417288c0e1099b1eeec3 # v2.7.7
424
+ uses : Swatinem/rust-cache@v2
425
425
with :
426
426
cache-directories : ${{ env.CARGO_TARGET_DIR }}
427
427
cache-all-crates : true
@@ -436,7 +436,8 @@ jobs:
436
436
# at the same time, hence we use this workaround.
437
437
QUICKCHECK_TESTS : 0
438
438
run : |
439
- rustup toolchain remove nightly-2025-02-20; rustup toolchain remove stable; rustup toolchain remove 1.85.0;
439
+ rustup toolchain remove nightly-2025-02-20
440
+ rustup toolchain remove stable
440
441
cargo +nightly nextest run --all-features --no-fail-fast --workspace --locked --jobs 1 --partition count:${{ matrix.partition }}/30
441
442
442
443
test-docs :
@@ -458,7 +459,7 @@ jobs:
458
459
fetch-depth : 1
459
460
460
461
- name : Cache
461
- uses : Swatinem/rust-cache@f0deed1e0edfc6a9be95417288c0e1099b1eeec3 # v2.7.7
462
+ uses : Swatinem/rust-cache@v2
462
463
with :
463
464
cache-directories : ${{ env.CARGO_TARGET_DIR }}
464
465
cache-all-crates : true
@@ -503,7 +504,7 @@ jobs:
503
504
fetch-depth : 1
504
505
505
506
- name : Cache
506
- uses : Swatinem/rust-cache@f0deed1e0edfc6a9be95417288c0e1099b1eeec3 # v2.7.7
507
+ uses : Swatinem/rust-cache@v2
507
508
with :
508
509
cache-directories : ${{ env.CARGO_TARGET_DIR }}
509
510
cache-all-crates : true
@@ -539,7 +540,7 @@ jobs:
539
540
fetch-depth : 1
540
541
541
542
- name : Cache
542
- uses : Swatinem/rust-cache@f0deed1e0edfc6a9be95417288c0e1099b1eeec3 # v2.7.7
543
+ uses : Swatinem/rust-cache@v2
543
544
with :
544
545
cache-directories : ${{ env.CARGO_TARGET_DIR }}
545
546
cache-all-crates : true
@@ -588,7 +589,7 @@ jobs:
588
589
# uses: ./.github/rust-info
589
590
#
590
591
# - name: Cache
591
- # uses: Swatinem/rust-cache@f0deed1e0edfc6a9be95417288c0e1099b1eeec3 # v2.7.7
592
+ # uses: Swatinem/rust-cache@v2
592
593
# with:
593
594
# cache-on-failure: true
594
595
# cache-directories: ${{ env.CARGO_TARGET_DIR }}
@@ -630,7 +631,7 @@ jobs:
630
631
fetch-depth : 1
631
632
632
633
- name : Cache
633
- uses : Swatinem/rust-cache@f0deed1e0edfc6a9be95417288c0e1099b1eeec3 # v2.7.7
634
+ uses : Swatinem/rust-cache@v2
634
635
with :
635
636
cache-directories : ${{ env.CARGO_TARGET_DIR }}
636
637
cache-all-crates : true
@@ -661,7 +662,7 @@ jobs:
661
662
fetch-depth : 1
662
663
663
664
- name : Cache
664
- uses : Swatinem/rust-cache@f0deed1e0edfc6a9be95417288c0e1099b1eeec3 # v2.7.7
665
+ uses : Swatinem/rust-cache@v2
665
666
with :
666
667
cache-directories : ${{ env.CARGO_TARGET_DIR }}
667
668
cache-all-crates : true
@@ -698,7 +699,7 @@ jobs:
698
699
fetch-depth : 1
699
700
700
701
- name : Cache
701
- uses : Swatinem/rust-cache@f0deed1e0edfc6a9be95417288c0e1099b1eeec3 # v2.7.7
702
+ uses : Swatinem/rust-cache@v2
702
703
with :
703
704
cache-directories : ${{ env.CARGO_TARGET_DIR }}
704
705
cache-all-crates : true
@@ -725,7 +726,7 @@ jobs:
725
726
RUSTFLAGS : -Clink-arg=-z -Clink-arg=nostart-stop-gc -Clink-dead-code
726
727
run : |
727
728
# run flipper E2E test with on-chain contract
728
- substrate-contracts -node -lruntime::revive=debug 2>&1 &
729
+ ink -node -lruntime::revive=debug 2>&1 &
729
730
cargo +nightly contract build --release --manifest-path integration-tests/public/flipper/Cargo.toml
730
731
export CONTRACT_ADDR_HEX=$(cargo +nightly-2025-02-20 contract instantiate \
731
732
--manifest-path integration-tests/public/flipper/Cargo.toml \
@@ -737,7 +738,7 @@ jobs:
737
738
e2e_test_deployed_contract \
738
739
-- --ignored --nocapture
739
740
740
- examples-contract-build :
741
+ examples-contract-build-riscv :
741
742
runs-on : ubuntu-latest
742
743
needs : [set-image, build]
743
744
defaults :
@@ -748,36 +749,77 @@ jobs:
748
749
strategy :
749
750
fail-fast : false
750
751
matrix :
751
- type : [RISCV]
752
- partition : [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
752
+ partition : [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]
753
753
steps :
754
754
- name : Checkout
755
755
uses : actions/checkout@v4
756
756
with :
757
757
fetch-depth : 1
758
758
759
759
- name : Cache
760
- uses : Swatinem/rust-cache@f0deed1e0edfc6a9be95417288c0e1099b1eeec3 # v2.7.7
760
+ uses : Swatinem/rust-cache@v2
761
761
with :
762
762
cache-directories : ${{ env.CARGO_TARGET_DIR }}
763
763
cache-all-crates : true
764
764
765
765
- name : Rust Info
766
766
uses : ./.github/rust-info
767
767
768
- - name : Build Contract RISCV Examples
769
- if : ${{ matrix.type == 'RISCV' }}
768
+ - name : Extract branch name
769
+ shell : bash
770
+ run : echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
771
+ id : extract_branch
772
+
773
+ - name : Build Contract Examples for RISC-V
770
774
env :
771
775
RUSTC_BOOTSTRAP : 1
776
+ MANIFEST_PATH : " "
777
+ CONTRACT_SIZE_FILE : " measurements-${{ steps.extract_branch.outputs.branch }}/contract_size_"
772
778
run : |
773
- # We skip some examples for those reasons:
774
- # This uses dlmalloc which is only supported on select targets.
775
- # - custom_allocator
776
- # Pulls in sp-std which needlessly requires atomic pointers (TODO: Fix sp-std and enable this example)
777
- # - call-runtime
778
- scripts/for_all_contracts_exec.sh --path integration-tests --ignore public/custom-allocator --ignore public/call-runtime --ignore public/contract-xcm \
779
- --partition ${{ matrix.partition }}/15 -- \
780
- cargo +nightly build --manifest-path {} --no-default-features --target $RISCV_TARGET -Zbuild-std="core,alloc"
779
+ mkdir -p measurements-${{ steps.extract_branch.outputs.branch }}/
780
+ scripts/for_all_contracts_exec2.sh --path integration-tests --partition ${{ matrix.partition }}/20 --ignore integration-tests/public/multi-contract-caller -- \
781
+ scripts/build_and_determine_contract_size.sh {}
782
+
783
+ #bash -c "scripts/build_and_determine_contract_size.sh {} >> ${CONTRACT_SIZE_FILE} && \
784
+ #sed -ie 's/^integration-tests\/\(public\/\|internal\/\)\?//' ${CONTRACT_SIZE_FILE}"
785
+
786
+ - uses : actions/upload-artifact@v4
787
+ # env:
788
+ # CONTRACT_SIZE_FILE: ${{ matrix.branch }}_contract_size_${{ matrix.partition }}
789
+ with :
790
+ # name: ${{ github.job }}-${{ matrix.branch }}-data
791
+ # name: ./measurements-${{ PR_NUMBER }}
792
+ path : ./measurements-${{ steps.extract_branch.outputs.branch }}/*
793
+ name : ${{ env.RUN_UNIQUE_ID }}_artifact_${{ matrix.partition }}
794
+ retention-days : 1
795
+
796
+ process-contract-sizes :
797
+ needs : [examples-contract-build-riscv]
798
+ runs-on : ubuntu-latest
799
+ steps :
800
+ - name : Download reports' artifacts
801
+ uses : actions/download-artifact@v4
802
+ with :
803
+ path : downloaded_artifacts
804
+
805
+ - name : Extract branch name
806
+ shell : bash
807
+ run : echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
808
+ id : extract_branch
809
+
810
+ - name : Combine contract sizes from individual examples
811
+ run : |
812
+ find .
813
+ cat downloaded_artifacts/*/* | \
814
+ sed -e 's/^integration-tests\/\(public\/\|internal\/\)\?//' | \
815
+ sort | uniq > measurements-${{ steps.extract_branch.outputs.branch }}
816
+ echo "----"
817
+ cat measurements-${{ steps.extract_branch.outputs.branch }}
818
+
819
+ - uses : actions/upload-artifact@v4
820
+ with :
821
+ path : ./measurements-${{ steps.extract_branch.outputs.branch }}
822
+ retention-days : 31
781
823
782
824
examples-docs :
783
825
runs-on : ubuntu-latest
@@ -794,7 +836,7 @@ jobs:
794
836
fetch-depth : 1
795
837
796
838
- name : Cache
797
- uses : Swatinem/rust-cache@f0deed1e0edfc6a9be95417288c0e1099b1eeec3 # v2.7.7
839
+ uses : Swatinem/rust-cache@v2
798
840
with :
799
841
cache-directories : ${{ env.CARGO_TARGET_DIR }}
800
842
cache-all-crates : true
@@ -823,13 +865,10 @@ jobs:
823
865
# fuzz
824
866
fuzz :
825
867
runs-on : ubuntu-latest
826
- # todo bring back more needs, so that we only run this `fuzz` stage
827
- # if pre-conditions are filled.
828
- # needs: [set-image, examples-docs, examples-contract-build, examples-test, examples-custom-test]
829
- needs : [set-image]
830
- # if: >
831
- # github.event_name == 'push' &&
832
- # github.ref == 'refs/heads/master'
868
+ needs : [set-image, examples-docs, examples-contract-build-riscv, examples-test, examples-custom-test]
869
+ if : >
870
+ github.event_name == 'push' &&
871
+ github.ref == 'refs/heads/master'
833
872
permissions :
834
873
issues : write
835
874
defaults :
@@ -844,7 +883,7 @@ jobs:
844
883
fetch-depth : 1
845
884
846
885
- name : Cache
847
- uses : Swatinem/rust-cache@f0deed1e0edfc6a9be95417288c0e1099b1eeec3 # v2.7.7
886
+ uses : Swatinem/rust-cache@v2
848
887
with :
849
888
cache-directories : ${{ env.CARGO_TARGET_DIR }}
850
889
cache-all-crates : true
0 commit comments