Skip to content

acceptance-test-failure #406

acceptance-test-failure

acceptance-test-failure #406

name: Promote to Nightly
on:
repository_dispatch:
types: [acceptance-test-success, acceptance-test-failure, data-regeneration-success, data-regeneration-failure, evm-test-failure, evm-test-build-failure, evm-test-startup-failure]
permissions:
contents: write
env:
NIGHTLY_BRANCH: 'nightly'
jobs:
promote:
runs-on: nscloud-ubuntu-24.04-amd64-2x4
timeout-minutes: 10
steps:
- name: Log event details
run: |
echo "Event type: ${{ github.event.action }}"
echo "Commit SHA: ${{ github.event.client_payload.commit_sha }}"
echo "Test duration: ${{ github.event.client_payload.test_duration_seconds }}s"
- name: Validate payload
id: validate
run: |
if [ -z "${{ github.event.client_payload.commit_sha }}" ]; then
echo "❌ Missing required field: commit_sha"
exit 1
fi
echo "✅ Payload validation passed"
- name: Checkout commit
id: checkout
uses: actions/checkout@v6
with:
ref: ${{ github.event.client_payload.commit_sha }}
fetch-depth: 0
ssh-key: ${{ secrets.ACCEPTANCE_TEST_DEPLOY_KEY }}
- name: Promote to nightly on success
id: promote
if: github.event.action == 'acceptance-test-success'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
NIGHTLY_BRANCH="${{ env.NIGHTLY_BRANCH }}"
COMMIT_SHA="${{ github.event.client_payload.commit_sha }}"
SHORT_SHA=$(git rev-parse --short "$COMMIT_SHA")
echo "Attempting to fast-forward $NIGHTLY_BRANCH to $SHORT_SHA"
# Fetch the nightly branch
git fetch origin "$NIGHTLY_BRANCH"
# Verify this is a fast-forward
if ! git merge-base --is-ancestor "origin/$NIGHTLY_BRANCH" HEAD; then
echo "❌ ERROR: Cannot fast-forward $NIGHTLY_BRANCH to this commit"
echo "The nightly branch has diverged from the dev branch"
exit 1
fi
# Push the fast-forward
git push origin "HEAD:$NIGHTLY_BRANCH"
COMMIT_MESSAGE=$(git log -1 --pretty=%s "$COMMIT_SHA")
echo "✅ Successfully promoted $SHORT_SHA to $NIGHTLY_BRANCH"
echo "Commit: $COMMIT_MESSAGE"
echo "Test duration: ${{ github.event.client_payload.test_duration_seconds }}s"
- name: Slack notification on acceptance test failure
if: github.event.action == 'acceptance-test-failure'
uses: slackapi/slack-github-action@v2.1.1
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
webhook-type: incoming-webhook
payload: |
text: "❌ *Nightly acceptance tests failed*\n\nCommit `${{ github.event.client_payload.commit_sha }}` failed to be promoted to nightly.\n\n*Test duration:* ${{ github.event.client_payload.test_duration_seconds }}s\n\n*View details:* SSH to the build server and `less -R /opt/acceptance-tests-runner/test-runs/${{ github.event.client_payload.test_dir_name }}/logs/output.log`\n\n*Workflow run:* ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
- name: Slack notification on fast-forward failure
if: steps.promote.outcome == 'failure'
uses: slackapi/slack-github-action@v2.1.1
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
webhook-type: incoming-webhook
payload: |
text: "⚠️ *Fast-forward to nightly failed*\n\nCannot fast-forward `${{ env.NIGHTLY_BRANCH }}` to commit `${{ github.event.client_payload.commit_sha }}`.\n\nThe nightly branch has diverged from the dev branch. Manual intervention required.\n\n*Workflow run:* ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
- name: Slack notification on validation failure
if: failure() && (steps.validate.outcome == 'failure' || steps.checkout.outcome == 'failure')
uses: slackapi/slack-github-action@v2.1.1
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
webhook-type: incoming-webhook
payload: |
text: "🚨 *Nightly promotion validation failed*\n\nInvalid payload or commit in repository dispatch event.\n\n*Event type:* `${{ github.event.action }}`\n*Commit ref:* `${{ github.event.client_payload.commit_sha }}`\n\n*Workflow run:* ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
- name: Slack notification on data regeneration success
if: github.event.action == 'data-regeneration-success'
uses: slackapi/slack-github-action@v2.1.1
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
webhook-type: incoming-webhook
payload: |
text: "⚠️ *Acceptance test data regeneration completed*\n\nAfter the recent acceptance test failure, new candidate data has been generated for commit `${{ github.event.client_payload.commit_sha }}`.\n\n*Location:* `/mnt/data/candidate-regenerated-acceptance-test-data`\n\nTo use this data, swap it into place on the build server:\n```\nrm -rf /mnt/data/runner-acceptance-test-data\nmv /mnt/data/candidate-regenerated-acceptance-test-data /mnt/data/runner-acceptance-test-data\n```"
- name: Slack notification on data regeneration failure
if: github.event.action == 'data-regeneration-failure'
uses: slackapi/slack-github-action@v2.1.1
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
webhook-type: incoming-webhook
payload: |
text: "⚠️ *Acceptance test data regeneration failed*\n\nAutomatic data regeneration for commit `${{ github.event.client_payload.commit_sha }}` failed.\n\n*View logs:* `less -R /opt/acceptance-tests-runner/test-runs/${{ github.event.client_payload.test_dir_name }}/logs/regeneration.log`"
- name: Slack notification on EVM test failure
if: github.event.action == 'evm-test-failure'
uses: slackapi/slack-github-action@v2.1.1
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
webhook-type: incoming-webhook
payload: |
text: "❌ *EVM acceptance tests failed*\n\nCommit `${{ github.event.client_payload.commit_sha }}`\n\n*Test duration:* ${{ github.event.client_payload.test_duration_seconds }}s\n\n*View logs:* SSH to the build server and check `/opt/acceptance-tests-runner/test-runs/${{ github.event.client_payload.test_dir_name }}/logs/`\n\n*Workflow run:* ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
- name: Slack notification on EVM build failure
if: github.event.action == 'evm-test-build-failure'
uses: slackapi/slack-github-action@v2.1.1
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
webhook-type: incoming-webhook
payload: |
text: "🔨 *EVM test Docker build failed*\n\nCommit `${{ github.event.client_payload.commit_sha }}`\n\nFailed to build rollup Docker container.\n\n*View logs:* SSH to the build server and check `/opt/acceptance-tests-runner/test-runs/${{ github.event.client_payload.test_dir_name }}/logs/build.log`\n\n*Workflow run:* ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
- name: Slack notification on EVM startup failure
if: github.event.action == 'evm-test-startup-failure'
uses: slackapi/slack-github-action@v2.1.1
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
webhook-type: incoming-webhook
payload: |
text: "🚀 *EVM test rollup startup failed*\n\nCommit `${{ github.event.client_payload.commit_sha }}`\n\nRollup container failed to start or reach healthcheck.\n\n*View logs:* SSH to the build server and check `/opt/acceptance-tests-runner/test-runs/${{ github.event.client_payload.test_dir_name }}/logs/`\n\n*Workflow run:* ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"