Production Synthetic Monitoring #10
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: Production Synthetic Monitoring | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "0 8 * * 1" | |
| permissions: | |
| contents: read | |
| issues: write | |
| concurrency: | |
| group: production-synthetic-monitoring | |
| cancel-in-progress: false | |
| jobs: | |
| synthetic: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| defaults: | |
| run: | |
| working-directory: src/Exceptionless.Web/ClientApp | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup Node.js environment | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| - name: Install Npm Packages | |
| run: npm ci | |
| - name: Install Playwright Chromium | |
| run: npx playwright install chromium --with-deps | |
| - name: Run Production Synthetic Check | |
| env: | |
| E2E_URL: https://app.exceptionless.io | |
| E2E_RUN_ID: production-${{ github.run_id }}-${{ github.run_attempt }} | |
| run: npm run test:e2e:prod | |
| - name: Write Summary | |
| if: ${{ always() }} | |
| run: | | |
| echo "### Production Synthetic Monitoring" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "- Run ID: production-${{ github.run_id }}-${{ github.run_attempt }}" >> $GITHUB_STEP_SUMMARY | |
| echo "- E2E URL: https://app.exceptionless.io" >> $GITHUB_STEP_SUMMARY | |
| - name: Upload Playwright Report | |
| if: ${{ !cancelled() }} | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: production-synthetic-playwright-report | |
| path: src/Exceptionless.Web/ClientApp/playwright-report/ | |
| retention-days: 14 | |
| - name: Upload Playwright Test Results | |
| if: ${{ !cancelled() }} | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: production-synthetic-playwright-test-results | |
| path: src/Exceptionless.Web/ClientApp/test-results/ | |
| retention-days: 14 | |
| - name: Open Failure Alert Issue | |
| if: ${{ failure() }} | |
| uses: actions/github-script@v8 | |
| with: | |
| script: | | |
| const title = "Production Synthetic Monitoring is failing"; | |
| const runUrl = `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`; | |
| const body = [ | |
| "Production Synthetic Monitoring failed.", | |
| "", | |
| `- Run: ${runUrl}`, | |
| `- Run ID: production-${context.runId}-${process.env.GITHUB_RUN_ATTEMPT}`, | |
| "- E2E URL: https://app.exceptionless.io", | |
| "", | |
| "Review the Playwright report and test-results artifacts attached to the workflow run." | |
| ].join("\n"); | |
| const { owner, repo } = context.repo; | |
| const issues = await github.paginate(github.rest.issues.listForRepo, { | |
| owner, | |
| repo, | |
| state: "open", | |
| creator: "github-actions[bot]", | |
| per_page: 100 | |
| }); | |
| const existing = issues.find((issue) => issue.title === title && !issue.pull_request); | |
| if (existing) { | |
| await github.rest.issues.createComment({ | |
| owner, | |
| repo, | |
| issue_number: existing.number, | |
| body | |
| }); | |
| core.notice(`Updated production synthetic alert issue #${existing.number}.`); | |
| return; | |
| } | |
| const issue = await github.rest.issues.create({ | |
| owner, | |
| repo, | |
| title, | |
| body | |
| }); | |
| core.notice(`Created production synthetic alert issue #${issue.data.number}.`); |