fix: Correct branch references from main to master #238
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: Test | |
| on: | |
| push: | |
| branches: ['**'] | |
| pull_request: | |
| branches: ['**'] | |
| permissions: | |
| contents: read | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.26' | |
| - name: Run tests with race detection | |
| run: go test -v -race ./... | |
| - name: Run golangci-lint | |
| uses: golangci/golangci-lint-action@v9 | |
| with: | |
| version: latest | |
| - name: Generate coverage profile | |
| run: go test -coverprofile=coverage.out -covermode=atomic ./... | |
| - name: Upload coverage artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: code-coverage | |
| path: coverage.out | |
| - name: Check coverage threshold | |
| uses: vladopajic/go-test-coverage@v2 | |
| with: | |
| config: ./.testcoverage.yml | |
| profile: coverage.out | |
| git-token: ${{ github.ref_name == 'master' && secrets.GITHUB_TOKEN || '' }} | |
| git-branch: badges | |
| coverage-report: | |
| name: Coverage report | |
| if: github.event_name == 'pull_request' | |
| runs-on: ubuntu-latest | |
| needs: test | |
| permissions: | |
| contents: read | |
| actions: read | |
| pull-requests: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - uses: fgrosse/go-coverage-report@v1.1.1 | |
| with: | |
| coverage-artifact-name: code-coverage | |
| coverage-file-name: coverage.out |