e2e-canary #4
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: e2e-canary | |
| on: | |
| schedule: | |
| - cron: "31 6 * * *" | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| issues: write | |
| concurrency: | |
| group: e2e-canary-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| canary: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 45 | |
| environment: canary-e2e | |
| steps: | |
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 | |
| with: | |
| node-version-file: .tool-versions | |
| - uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0 | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Run canary e2e tests | |
| env: | |
| ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} | |
| BRAINTRUST_API_KEY: ${{ secrets.BRAINTRUST_API_KEY }} | |
| GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} | |
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
| OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }} | |
| run: pnpm test:e2e:canary | |
| - name: Create or update nightly canary issue | |
| if: ${{ failure() && github.event_name == 'schedule' }} | |
| uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 | |
| with: | |
| script: | | |
| const { owner, repo } = context.repo; | |
| const title = "[canary] e2e canary failures"; | |
| const body = [ | |
| "Nightly e2e canary failed.", | |
| "", | |
| `- Date: ${new Date().toISOString().slice(0, 10)}`, | |
| `- Branch: ${context.ref.replace("refs/heads/", "")}`, | |
| `- Commit: ${context.sha}`, | |
| `- Run: ${context.serverUrl}/${owner}/${repo}/actions/runs/${context.runId}`, | |
| ].join("\n"); | |
| const issues = await github.paginate(github.rest.issues.listForRepo, { | |
| owner, | |
| repo, | |
| state: "open", | |
| per_page: 100, | |
| }); | |
| const existing = issues.find((issue) => issue.title === title); | |
| if (existing) { | |
| await github.rest.issues.update({ | |
| owner, | |
| repo, | |
| issue_number: existing.number, | |
| body, | |
| }); | |
| return; | |
| } | |
| await github.rest.issues.create({ | |
| owner, | |
| repo, | |
| title, | |
| body, | |
| }); |