Merge pull request #1184 from cloudflare/dependabot/github_actions/th… #2693
This file contains 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 Go code | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
permissions: read-all | |
jobs: | |
test-go: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
show-progress: false | |
- name: Set up Go | |
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0 | |
with: | |
go-version-file: go.ver | |
cache: false | |
- name: Test | |
run: make test | |
- name: Check for local changes | |
run: git diff --exit-code | |
# Codecov reporting is unreliable. | |
# Re-run report 3 times to have a better | |
# chance of success. | |
- name: Report code coverage (1) | |
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: ./.cover/coverage.out | |
fail_ci_if_error: true | |
handle_no_reports_found: true | |
continue-on-error: true | |
- name: Report code coverage (2) | |
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: ./.cover/coverage.out | |
fail_ci_if_error: true | |
handle_no_reports_found: true | |
continue-on-error: true | |
- name: Report code coverage (3) | |
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: ./.cover/coverage.out | |
fail_ci_if_error: true | |
handle_no_reports_found: true |