1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
name: Run tests and upload coverage
on:
workflow_call:
permissions:
contents: read
jobs:
test:
name: Run tests and collect coverage
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
go-version:
- 1.25.x
platform:
- macos-latest
- windows-2025
- ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@71cf2267d89c5cb81562390fa70a37fa40b1305e
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@faf52423ec0d44c58f68e83b614bfcd99dded66f
with:
check-latest: true
go-version: ${{ matrix.go-version }}
cache: true
cache-dependency-path: "**/go.sum"
- name: Install dependencies
run: go mod download
- name: Run tests
run: |
go test -v -coverprofile coverage.out -covermode atomic ./...
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7
with:
token: ${{ secrets.CODECOV_TOKEN }}
|