-
Notifications
You must be signed in to change notification settings - Fork 1
Add ACT4 nightly compliance test workflow #631
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
22f27b6
Add ACT4 nightly compliance test workflow against zkevm-test-monitor
gabrielbosio b30c8ce
Temporary label-gated manual trigger for ACT4 nightly testing
gabrielbosio dbb1e05
Propagate pipeline exit code so build/test failures fail the workflow
gabrielbosio 0ec5513
Treat missing ACT4 summary files as workflow failure
gabrielbosio 1e71209
Use PR head SHA on pull_request events so the SHA exists in the lambd…
gabrielbosio c08c619
Consolidate pass/fail decision and job failure into the summary step
gabrielbosio 048c7b2
Use single act4-nightly label on opened issues
gabrielbosio 296a0b1
Scrub root-owned Docker leftovers before checkout
gabrielbosio 6eeb42b
Drop stale SHA from ACT4 issue title
gabrielbosio ed29f4f
Address bot-review findings: pin upstream SHA, split exec/report jobs…
gabrielbosio 5a3bcc2
Pin action SHAs and fail summary step when ./run exits non-zero
gabrielbosio 53cf696
Remove temporary pull_request label trigger
gabrielbosio 1bf370b
Pin ubuntu image by digest, pass step outcome via env, tolerate missi…
gabrielbosio f813789
Pin build Dockerfile ubuntu base image to digest
gabrielbosio b4aa43a
Temporarily re-add label trigger for a dry run
gabrielbosio d9339ca
Remove temporary label trigger
gabrielbosio 40fadf9
Merge branch 'main' into act4-nightly
gabrielbosio e8ea2b1
Comment on bench vs nightly decision
gabrielbosio eb12895
Clean root-owned Docker leftovers at end of ACT4 job
gabrielbosio 2e0e9ae
Merge branch 'main' into act4-nightly
gabrielbosio 3bced9a
Merge branch 'main' into act4-nightly
gabrielbosio 970bda9
ci(act4-nightly): run regardless of benchmark conclusion
MauroToscano 73f615a
ci(act4-nightly): notify Slack on failure instead of opening an issue
MauroToscano cbee95e
Merge branch 'main' into act4-nightly
MauroToscano 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
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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,187 @@ | ||
| name: ACT4 Nightly | ||
|
|
||
| on: | ||
| workflow_run: | ||
| # Runs after Bench Vs Nightly to make sure the self-hosted runner is available | ||
| workflows: ["Bench Vs Nightly"] | ||
| types: [completed] | ||
| branches: [main] | ||
| workflow_dispatch: | ||
|
|
||
| concurrency: | ||
| group: act4-nightly | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| test: | ||
| # ACT4 is independent of the benchmark outcome; the workflow_run trigger is | ||
| # only used to serialize on the shared bench runner. Run on any benchmark | ||
| # conclusion, skipping only cases where re-running is pointless: 'cancelled' | ||
| # (a newer bench run is already on its way) and 'skipped' (nothing ran). | ||
| if: >- | ||
| github.event_name == 'workflow_dispatch' || | ||
| (github.event.workflow_run.conclusion != 'cancelled' && | ||
| github.event.workflow_run.conclusion != 'skipped') | ||
| runs-on: [self-hosted, bench] | ||
| timeout-minutes: 360 | ||
| permissions: | ||
| contents: read | ||
| env: | ||
| LAMBDAVM_SHA: ${{ github.event.workflow_run.head_sha || github.sha }} | ||
| # ubuntu:24.04 linux/amd64 manifest digest (bench runner is x64). | ||
| UBUNTU_IMAGE: ubuntu@sha256:cdb5fd928fced577cfecf12c8966e830fcdf42ee481fb0b91904eeddc2fe5eff | ||
| steps: | ||
| - name: Validate LAMBDAVM_SHA format | ||
| run: | | ||
| if [[ ! "$LAMBDAVM_SHA" =~ ^[0-9a-f]{40}$ ]]; then | ||
| echo "Invalid LAMBDAVM_SHA: $LAMBDAVM_SHA" | ||
| exit 1 | ||
| fi | ||
|
|
||
| - name: Scrub root-owned leftovers from previous Docker runs | ||
| run: | | ||
| if [ -d test-results ] || [ -d out ]; then | ||
| docker run --rm -v "$PWD:/work" -w /work "$UBUNTU_IMAGE" rm -rf test-results out | ||
| fi | ||
|
|
||
| - name: Checkout zkevm-test-monitor | ||
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | ||
| with: | ||
| repository: eth-act/zkevm-test-monitor | ||
| ref: c9e710b43448576920f7e841a2b68bab8b7a20f8 | ||
|
|
||
| - name: Pin lambdavm.commit to current main SHA | ||
| run: | | ||
| echo "Pinning lambdavm.commit to $LAMBDAVM_SHA" | ||
| jq --arg sha "$LAMBDAVM_SHA" '.zkvms.lambdavm.commit = $sha' config.json > config.json.tmp | ||
| mv config.json.tmp config.json | ||
| jq '.zkvms.lambdavm' config.json | ||
|
|
||
| - name: Pin Dockerfile base image to digest | ||
| run: | | ||
| dockerfile=docker/build-lambdavm/Dockerfile | ||
| sed -i "s|^FROM ubuntu:24.04|FROM ${UBUNTU_IMAGE}|" "$dockerfile" | ||
| if grep -qE '^FROM .*ubuntu:24\.04' "$dockerfile"; then | ||
| echo "Unpinned ubuntu:24.04 still present in $dockerfile" | ||
| exit 1 | ||
| fi | ||
|
|
||
| - name: Build + test lambdavm | ||
| id: run | ||
| continue-on-error: true | ||
| run: | | ||
| set -o pipefail | ||
| mkdir -p out | ||
| ./run all lambdavm 2>&1 | tee out/run.log | ||
|
gabrielbosio marked this conversation as resolved.
|
||
|
|
||
| - name: Compute pass/fail from summaries | ||
| id: summary | ||
| if: always() | ||
| env: | ||
| STEP_RUN_OUTCOME: ${{ steps.run.outcome }} | ||
| run: | | ||
| mkdir -p out | ||
| shopt -s nullglob | ||
| summaries=(test-results/lambdavm/summary-act4-*.json) | ||
|
|
||
| # No summaries means the build/test pipeline failed to produce results. | ||
| if [ ${#summaries[@]} -eq 0 ]; then | ||
| msg="No ACT4 summary files were produced. See run.log." | ||
| echo "$msg" | tee out/summary.md | ||
| echo "$msg" >> "$GITHUB_STEP_SUMMARY" | ||
| exit 1 | ||
| fi | ||
|
|
||
| { | ||
| echo "## ACT4 results for lambdavm @ $LAMBDAVM_SHA" | ||
| echo "" | ||
| for f in "${summaries[@]}"; do | ||
| jq -r '"- **\(.suite)**: \(.passed)/\(.total) passed (\(.failed) failed)"' "$f" | ||
| done | ||
| } | tee out/summary.md >> "$GITHUB_STEP_SUMMARY" | ||
|
|
||
| FAILED=0 | ||
| for f in "${summaries[@]}"; do | ||
| n=$(jq '.failed // 0' "$f") | ||
| FAILED=$((FAILED + n)) | ||
| done | ||
| echo "Total failed tests: $FAILED" | ||
| if [ "$STEP_RUN_OUTCOME" = "failure" ]; then | ||
| echo "./run exited non-zero" | ||
| exit 1 | ||
| fi | ||
| [ "$FAILED" -eq 0 ] | ||
|
|
||
| - name: Upload artifacts | ||
| if: always() | ||
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 | ||
| with: | ||
| name: act4-results-${{ github.run_id }} | ||
| path: | | ||
| out/ | ||
| test-results/lambdavm/ | ||
| retention-days: 30 | ||
|
|
||
| - name: Remove root-owned Docker leftovers | ||
| # Leave the shared runner workspace clean for other workflows. | ||
| if: always() | ||
| run: | | ||
| if [ -d test-results ] || [ -d out ]; then | ||
| docker run --rm -v "$PWD:/work" -w /work "$UBUNTU_IMAGE" rm -rf test-results out | ||
| fi | ||
|
|
||
| report: | ||
| needs: test | ||
| if: failure() | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| env: | ||
| LAMBDAVM_SHA: ${{ github.event.workflow_run.head_sha || github.sha }} | ||
| steps: | ||
| - name: Validate LAMBDAVM_SHA format | ||
| run: | | ||
| if [[ ! "$LAMBDAVM_SHA" =~ ^[0-9a-f]{40}$ ]]; then | ||
| echo "Invalid LAMBDAVM_SHA: $LAMBDAVM_SHA" | ||
| exit 1 | ||
| fi | ||
|
|
||
| - name: Download test artifacts | ||
| # An early test-job failure may upload nothing. Still notify Slack, | ||
| # falling back to a placeholder when out/summary.md is absent. | ||
| continue-on-error: true | ||
| uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4 | ||
| with: | ||
| name: act4-results-${{ github.run_id }} | ||
|
|
||
| - name: Post failure to Slack | ||
| env: | ||
| # Reuse the nightly benchmark webhook so failures land in the channel | ||
| # the team already watches. Manual runs use the test webhook so smoke | ||
| # tests don't ping the real channel. | ||
| SLACK_WEBHOOK: ${{ github.event_name == 'workflow_dispatch' && secrets.BENCH_VS_SLACK_WEBHOOK_TEST || secrets.BENCH_VS_SLACK_WEBHOOK }} | ||
| RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | ||
| run: | | ||
| if [ -z "$SLACK_WEBHOOK" ]; then | ||
| echo "SLACK_WEBHOOK not configured, skipping notification." | ||
| exit 0 | ||
| fi | ||
|
|
||
| summary="$(cat out/summary.md 2>/dev/null || echo '_summary not available_')" | ||
|
|
||
| payload="$(jq -n \ | ||
| --arg sha "$LAMBDAVM_SHA" \ | ||
| --arg run "$RUN_URL" \ | ||
| --arg rid "$GITHUB_RUN_ID" \ | ||
| --arg summary "$summary" \ | ||
| '{ | ||
| blocks: [ | ||
| {type: "header", text: {type: "plain_text", text: ":x: ACT4 nightly failed", emoji: true}}, | ||
| {type: "section", text: {type: "mrkdwn", text: ("*Commit:* `" + $sha + "`\n*Run:* <" + $run + "|workflow run>\n*Artifacts:* `act4-results-" + $rid + "` (attached to the run)")}}, | ||
| {type: "section", text: {type: "mrkdwn", text: ("```" + $summary + "```")}} | ||
| ] | ||
| }')" | ||
|
|
||
| curl -fsS -X POST "$SLACK_WEBHOOK" \ | ||
| -H 'Content-Type: application/json; charset=utf-8' \ | ||
| --data "$payload" | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.