| 1 |
on: [push, pull_request] |
| 2 |
name: Test |
| 3 |
jobs: |
| 4 |
test: |
| 5 |
runs-on: ubuntu-latest |
| 6 |
steps: |
| 7 |
- name: Install Go |
| 8 |
uses: actions/setup-go@v6 |
| 9 |
with: |
| 10 |
go-version: '^1.25.0' |
| 11 |
- name: Checkout code |
| 12 |
uses: actions/checkout@v6 |
| 13 |
- uses: actions/cache@v4 |
| 14 |
with: |
| 15 |
path: ~/go/pkg/mod |
| 16 |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} |
| 17 |
restore-keys: | |
| 18 |
${{ runner.os }}-go- |
| 19 |
- name: Test |
| 20 |
run: go test -coverprofile=coverage.txt -covermode=atomic -race ./... |
| 21 |
- uses: codecov/codecov-action@v1 |
| 22 |
with: |
| 23 |
token: ${{ secrets.CODECOV_TOKEN }} |
| 24 |
file: ./coverage.txt |
| 25 |
flags: unittests |
| 26 |
fail_ci_if_error: false |