WIP: Proposal: Configure merge_queue on the repository (to replace tide) #280
Workflow file for this run
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: Go coverage | |
| permissions: | |
| contents: read | |
| on: | |
| pull_request: | |
| branches: ["main"] | |
| merge_group: | |
| push: | |
| branches: ["main"] | |
| # run at least once every 2 months to prevent the coverage artifact from expiring | |
| schedule: | |
| - cron: '14 3 2 */2 *' | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| go-coverage: | |
| name: Go coverage | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| pull-requests: write | |
| steps: | |
| - name: Harden runner | |
| uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 | |
| with: | |
| egress-policy: audit | |
| - name: Checkout | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| path: ${{ github.workspace }}/src/github.com/tektoncd/pipeline | |
| - name: Set up Go | |
| uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0 | |
| with: | |
| go-version-file: "${{ github.workspace }}/src/github.com/tektoncd/pipeline/go.mod" | |
| - name: Generate coverage | |
| working-directory: ${{ github.workspace }}/src/github.com/tektoncd/pipeline | |
| run: | | |
| go test -cover -coverprofile=coverage.txt ./... || true | |
| echo "Generated coverage profile" | |
| - name: Archive coverage results | |
| uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 | |
| with: | |
| name: code-coverage | |
| path: ${{ github.workspace }}/src/github.com/tektoncd/pipeline/coverage.txt | |
| - name: Comment on PR | |
| if: github.event_name == 'pull_request' | |
| uses: fgrosse/go-coverage-report@8c1d1a09864211d258937b1b1a5b849f7e4f2682 # v1.2.0 | |
| continue-on-error: true # This may fail if artifact on main branch does not exist (first run or expired) | |
| with: | |
| coverage-artifact-name: "code-coverage" | |
| coverage-file-name: "coverage.txt" |