chore: filter CI branches #2038
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: Go | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.22 | |
- name: Build | |
run: go build -v ./... | |
- name: Run coverage | |
run: export GOROOT=$(go env GOROOT); go test -race -coverprofile=coverage.txt -covermode=atomic -v ./... -json > test_results.json | |
- name: Test report | |
if: always() | |
run: cat test_results.json | go run gotest.tools/gotestsum@latest --format testdox | |
- name: Upload Go test results | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Go-results | |
path: test_results.json | |
- name: Upload coverage to Codecov | |
run: bash <(curl -s https://codecov.io/bash) | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |