| 1 | name: Go |
| 2 | |
| 3 | on: |
| 4 | push: |
| 5 | pull_request: |
| 6 | |
| 7 | jobs: |
| 8 | test: |
| 9 | name: Unit Tests |
| 10 | runs-on: ubuntu-latest |
| 11 | strategy: |
| 12 | matrix: |
| 13 | go: [ '1.18.x', '1.19.x', '1.20.x' ] |
| 14 | steps: |
| 15 | - name: Set up Go ${{ matrix.go }} |
| 16 | uses: actions/setup-go@v4 |
| 17 | with: |
| 18 | go-version: ${{ matrix.go }} |
| 19 | id: go |
| 20 | |
| 21 | - name: Check out code into the Go module directory |
| 22 | uses: actions/checkout@v3 |
| 23 | |
| 24 | - name: Get dependencies |
| 25 | run: | |
| 26 | go get -v -t -d ./... |
| 27 | |
| 28 | - name: Lint |
| 29 | uses: golangci/golangci-lint-action@v3 |
| 30 | with: |
| 31 | version: v1.51.2 |
| 32 | |
| 33 | - name: Test |
| 34 | run: go test -race -coverprofile=coverage.txt -covermode=atomic ./... |
| 35 | |
| 36 | - name: Codecov |
| 37 | uses: codecov/codecov-action@v2 |