Nightly Full Suite #52
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
| name: Nightly Full Suite | |
| on: | |
| schedule: | |
| - cron: "0 3 * * *" | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| issues: write | |
| jobs: | |
| build-and-test: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| node-version: [20, 22] | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| with: | |
| fetch-depth: 2 | |
| - uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4 | |
| - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: pnpm | |
| - run: pnpm install --frozen-lockfile | |
| - run: pnpm build | |
| - run: pnpm test | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| - uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4 | |
| - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - run: pnpm install --frozen-lockfile | |
| - run: pnpm lint | |
| - run: pnpm format:check | |
| smoke: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| - uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4 | |
| - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - run: pnpm install --frozen-lockfile | |
| - run: pnpm build | |
| - run: pnpm smoke | |
| audit: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| - uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4 | |
| - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - run: pnpm install --frozen-lockfile | |
| - run: pnpm audit --audit-level=high | |
| summary: | |
| if: always() | |
| needs: [build-and-test, lint, smoke, audit] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Collect results | |
| id: results | |
| run: | | |
| echo "## Nightly Full Suite Results" >> "$GITHUB_STEP_SUMMARY" | |
| echo "" >> "$GITHUB_STEP_SUMMARY" | |
| echo "| Job | Result |" >> "$GITHUB_STEP_SUMMARY" | |
| echo "|-----|--------|" >> "$GITHUB_STEP_SUMMARY" | |
| echo "| Build & Test (matrix) | ${{ needs.build-and-test.result }} |" >> "$GITHUB_STEP_SUMMARY" | |
| echo "| Lint & Format | ${{ needs.lint.result }} |" >> "$GITHUB_STEP_SUMMARY" | |
| echo "| Smoke Tests | ${{ needs.smoke.result }} |" >> "$GITHUB_STEP_SUMMARY" | |
| echo "| Audit | ${{ needs.audit.result }} |" >> "$GITHUB_STEP_SUMMARY" | |
| echo "" >> "$GITHUB_STEP_SUMMARY" | |
| echo "Run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" >> "$GITHUB_STEP_SUMMARY" | |
| # Determine if any job failed (including audit — nightly should alert on vulnerabilities) | |
| FAILED="false" | |
| for result in "${{ needs.build-and-test.result }}" "${{ needs.lint.result }}" "${{ needs.smoke.result }}" "${{ needs.audit.result }}"; do | |
| if [[ "$result" != "success" ]]; then | |
| FAILED="true" | |
| fi | |
| done | |
| echo "failed=$FAILED" >> "$GITHUB_OUTPUT" | |
| - name: Create issue on failure | |
| if: steps.results.outputs.failed == 'true' | |
| uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v7 | |
| with: | |
| script: | | |
| const results = { | |
| 'build-and-test': '${{ needs.build-and-test.result }}', | |
| 'lint': '${{ needs.lint.result }}', | |
| 'smoke': '${{ needs.smoke.result }}', | |
| 'audit': '${{ needs.audit.result }}' | |
| }; | |
| const failed = Object.entries(results) | |
| .filter(([, v]) => v !== 'success') | |
| .map(([k, v]) => `- **${k}**: ${v}`) | |
| .join('\n'); | |
| const runUrl = `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`; | |
| await github.rest.issues.create({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| title: `Nightly suite failure — ${new Date().toISOString().slice(0, 10)}`, | |
| body: `The nightly full suite run failed.\n\n**Failed jobs:**\n${failed}\n\n**Run:** ${runUrl}`, | |
| labels: ['bug', 'area: infra'] | |
| }); |