Flaky Tests Report #5
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: Flaky Tests Report | |
| on: | |
| schedule: | |
| # Run on Wednesdays at noon Eastern time (5 PM UTC) | |
| - cron: "0 17 * * 3" | |
| workflow_dispatch: | |
| inputs: | |
| days: | |
| description: "Number of days to look back for flaky tests" | |
| required: false | |
| default: "7" | |
| type: string | |
| max_links: | |
| description: "Maximum number of failure links to show per test" | |
| required: false | |
| default: "3" | |
| type: string | |
| permissions: | |
| contents: read | |
| actions: read | |
| jobs: | |
| flaky-tests-report: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Generate token | |
| id: generate_token | |
| uses: actions/create-github-app-token@v1 | |
| with: | |
| app-id: ${{ secrets.TEMPORAL_CICD_APP_ID }} | |
| private-key: ${{ secrets.TEMPORAL_CICD_PRIVATE_KEY }} | |
| owner: ${{ github.repository_owner }} | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| with: | |
| persist-credentials: false | |
| token: ${{ steps.generate_token.outputs.token }} | |
| fetch-depth: 0 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: "go.mod" | |
| - name: Generate flaky test report | |
| id: process-flaky-tests | |
| env: | |
| GH_TOKEN: ${{ steps.generate_token.outputs.token }} | |
| SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
| DAYS_PARAM: ${{ github.event.inputs.days || '7' }} | |
| MAX_LINKS_PARAM: ${{ github.event.inputs.max_links || '3' }} | |
| RUN_ID: ${{ github.run_id }} | |
| REF_NAME: ${{ github.ref_name }} | |
| SHA: ${{ github.sha }} | |
| run: | | |
| set -euo pipefail | |
| go run ./cmd/tools/flakereport generate \ | |
| --days "$DAYS_PARAM" \ | |
| --max-links "$MAX_LINKS_PARAM" \ | |
| --output-dir tools/flakes/out \ | |
| --slack-webhook "$SLACK_WEBHOOK" \ | |
| --run-id "$RUN_ID" \ | |
| --ref-name "$REF_NAME" \ | |
| --sha "$SHA" | |
| - name: Upload generated reports | |
| uses: actions/upload-artifact@v4 | |
| if: steps.process-flaky-tests.outcome == 'success' | |
| with: | |
| name: flaky-tests-reports-${{ github.run_number }} | |
| path: tools/flakes/out/* | |
| retention-days: 30 |