@@ -194,7 +194,7 @@ jobs:
194194 runs-on : ubicloud-standard-30
195195 steps :
196196 - uses : actions/checkout@v5
197- - uses : dtolnay/rust-toolchain@1.85 .0
197+ - uses : dtolnay/rust-toolchain@1.88 .0
198198 with :
199199 components : llvm-tools-preview
200200 - name : Rust Cache
@@ -359,7 +359,7 @@ jobs:
359359 version : " 23.2"
360360 repo-token : ${{ secrets.GITHUB_TOKEN }}
361361 - name : Toolchain
362- uses : dtolnay/rust-toolchain@1.85 .0
362+ uses : dtolnay/rust-toolchain@1.88 .0
363363 - name : Rust Cache
364364 uses : ubicloud/rust-cache@v2
365365 - name : Setup env
@@ -415,6 +415,7 @@ jobs:
415415 uses : foundry-rs/foundry-toolchain@v1
416416 with :
417417 cache : false
418+ version : " v1.3.6"
418419
419420 - name : Run Forge build
420421 run : |
@@ -551,106 +552,108 @@ jobs:
551552 chmod +x ./.github/scripts/run-proving-test.sh
552553 ./.github/scripts/run-proving-test.sh patch-stats.json
553554 shell : bash
554-
555+ # Run/recover tests on the base branch
555556 - name : Get current commit hash
556557 id : current-commit
557558 run : |
558559 echo "patch-hash=${{ github.event.pull_request.head.sha }}" >> $GITHUB_OUTPUT
559560 echo "head-hash=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
560561
561- - name : Get commit hash of nightly branch
562- id : nightly -commit
562+ - name : Get commit hash of the base branch
563+ id : base -commit
563564 run : |
564- git fetch origin nightly
565- echo "nightly-hash=$(git rev-parse origin/nightly)" >> $GITHUB_OUTPUT
565+ BASE_REF="${{ github.event.pull_request.base.ref }}"
566+ git fetch origin "$BASE_REF"
567+ echo "base-hash=$(git rev-parse origin/"$BASE_REF")" >> $GITHUB_OUTPUT
566568
567- - name : Restore nightly test cache
568- id : restore-nightly
569+ - name : Restore base branch test cache
570+ id : restore-test-cache
569571 uses : actions/cache@v4
570572 with :
571- path : proving-stats/results/nightly -stats.json
572- key : nightly- proving-stats-${{ steps.nightly -commit.outputs.nightly -hash }}
573+ path : proving-stats/results/base -stats.json
574+ key : proving-stats-${{ steps.base -commit.outputs.base -hash }}
573575
574576 # --- Run test only if cache missed ---
575- - name : Download nightly build artifact
577+ - name : Download base build artifact
576578 id : download-artifact
577- if : steps.restore-nightly .outputs.cache-hit != 'true'
579+ if : steps.restore-test-cache .outputs.cache-hit != 'true'
578580 continue-on-error : true
579581 uses : dawidd6/action-download-artifact@v11
580582 with :
581583 name : citrea-build
582- ref : nightly
584+ ref : ${{ steps.base-commit.outputs.base-hash }}
583585 path : target/debug
584586 if_no_artifact_found : warn
587+ workflow_conclusion : " "
585588
586- - name : Checkout nightly branch
587- if : steps.restore-nightly .outputs.cache-hit != 'true'
588- run : git checkout -f ${{ steps.nightly -commit.outputs.nightly -hash }}
589+ - name : Checkout to base branch
590+ if : steps.restore-test-cache .outputs.cache-hit != 'true'
591+ run : git checkout -f ${{ steps.base -commit.outputs.base -hash }}
589592
590593 # install risc0 again as version may differ between branches
591594 - name : Install risc0
592- if : steps.restore-nightly .outputs.cache-hit != 'true'
595+ if : steps.restore-test-cache .outputs.cache-hit != 'true'
593596 uses : ./.github/actions/install-risc0
594597 with :
595598 github_token : ${{ secrets.GITHUB_TOKEN }}
596599
597600 # --- Build only if the artifact is not found ---
598601 - name : Install Rust toolchain
599- if : steps.restore-nightly .outputs.cache-hit != 'true' && steps.download-artifact.outputs.found_artifact != 'true'
602+ if : steps.restore-test-cache .outputs.cache-hit != 'true' && steps.download-artifact.outputs.found_artifact != 'true'
600603 uses : dtolnay/rust-toolchain@nightly
601604
602605 - name : Setup mold linker
603- if : steps.restore-nightly .outputs.cache-hit != 'true' && steps.download-artifact.outputs.found_artifact != 'true'
606+ if : steps.restore-test-cache .outputs.cache-hit != 'true' && steps.download-artifact.outputs.found_artifact != 'true'
604607 uses : rui314/setup-mold@v1
605608
606609 - name : Install Protoc
607- if : steps.restore-nightly .outputs.cache-hit != 'true' && steps.download-artifact.outputs.found_artifact != 'true'
610+ if : steps.restore-test-cache .outputs.cache-hit != 'true' && steps.download-artifact.outputs.found_artifact != 'true'
608611 uses : arduino/setup-protoc@v3
609612 with :
610613 version : " 23.2"
611614 repo-token : ${{ secrets.GITHUB_TOKEN }}
612615 - name : Rust cache
613- if : steps.restore-nightly .outputs.cache-hit != 'true' && steps.download-artifact.outputs.found_artifact != 'true'
616+ if : steps.restore-test-cache .outputs.cache-hit != 'true' && steps.download-artifact.outputs.found_artifact != 'true'
614617 uses : ubicloud/rust-cache@v2
615618 with :
616619 shared-key : build
617620 - name : Cache ethereum-tests
618- if : steps.restore-nightly .outputs.cache-hit != 'true' && steps.download-artifact.outputs.found_artifact != 'true'
621+ if : steps.restore-test-cache .outputs.cache-hit != 'true' && steps.download-artifact.outputs.found_artifact != 'true'
619622 uses : actions/cache@v4
620623 with :
621624 key : " eth-tests-1c23e3c"
622625 path : crates/evm/ethereum-tests
623- - name : Build citrea on nightly
624- if : steps.restore-nightly .outputs.cache-hit != 'true' && steps.download-artifact.outputs.found_artifact != 'true'
626+ - name : Build citrea on the base branch
627+ if : steps.restore-test-cache .outputs.cache-hit != 'true' && steps.download-artifact.outputs.found_artifact != 'true'
625628 run : make build
626629
627630 - name : Checkout to PR branch
628- if : steps.restore-nightly .outputs.cache-hit != 'true'
631+ if : steps.restore-test-cache .outputs.cache-hit != 'true'
629632 run : git checkout ${{ steps.current-commit.outputs.head-hash }}
630633
631634 # Sequencer DB is removed in run-proving-test.sh to avoid state corruption
632635 - name : Restore sequencer DB from test data
633- if : steps.restore-nightly .outputs.cache-hit != 'true'
636+ if : steps.restore-test-cache .outputs.cache-hit != 'true'
634637 run : |
635638 unzip archive.zip "dbs/*" -d proving-stats/
636639 - name : Make citrea executable
637- if : steps.restore-nightly .outputs.cache-hit != 'true'
640+ if : steps.restore-test-cache .outputs.cache-hit != 'true'
638641 run : chmod +x target/debug/citrea
639- - name : Run tests on nightly
640- if : steps.restore-nightly .outputs.cache-hit != 'true'
642+ - name : Run tests on the base branch
643+ if : steps.restore-test-cache .outputs.cache-hit != 'true'
641644 run : |
642645 chmod +x ./.github/scripts/run-proving-test.sh
643- ./.github/scripts/run-proving-test.sh nightly -stats.json
646+ ./.github/scripts/run-proving-test.sh base -stats.json
644647 shell : bash
645648
646649 - name : Compare the results
647650 working-directory : proving-stats
648651 run : |
649652 python compare-results.py \
650653 --patch-file results/patch-stats.json \
651- --nightly -file results/nightly -stats.json \
654+ --base -file results/base -stats.json \
652655 --patch-commit ${{ steps.current-commit.outputs.patch-hash }} \
653- --nightly -commit ${{ steps.nightly -commit.outputs.nightly -hash }}
656+ --base -commit ${{ steps.base -commit.outputs.base -hash }}
654657 - name : Find Comment
655658 uses : peter-evans/find-comment@v3
656659 id : fc
0 commit comments