| 1 | name: Go |
| 2 | on: |
| 3 | push: |
| 4 | branches: [ "main" ] |
| 5 | tags: [ "v*" ] |
| 6 | pull_request: |
| 7 | branches: [ "main" ] |
| 8 | jobs: |
| 9 | build: |
| 10 | runs-on: ubuntu-latest |
| 11 | steps: |
| 12 | - uses: actions/checkout@v4 |
| 13 | - name: Set up Go |
| 14 | uses: actions/setup-go@v5 |
| 15 | with: |
| 16 | go-version-file: go.mod |
| 17 | - name: Build |
| 18 | run: go build -v ./... |
| 19 | - name: Test |
| 20 | run: go test -race -coverprofile=coverage.out ./... |
| 21 | - uses: actions/upload-artifact@v4 |
| 22 | with: |
| 23 | name: coverage |
| 24 | path: coverage.out |
| 25 | retention-days: 5 |