diff --git a/.github/workflows/go-test.yml b/.github/workflows/go-test.yml new file mode 100644 index 0000000..a9cd0be --- /dev/null +++ b/.github/workflows/go-test.yml @@ -0,0 +1,36 @@ +name: Go Test + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + + test: + name: Test + runs-on: ubuntu-latest + steps: + + - name: Set up Go 1.x + uses: actions/setup-go@v2 + with: + go-version: ^1.15 + + - name: Check out code + uses: actions/checkout@v2 + + - name: Get dependencies + run: go get -v -t -d ./... + + - name: Run tests with race detection + run: go test -v -race ./... + + - name: Run tests with coverage + run: go test -v -coverprofile=coverage.txt -covermode=atomic ./... + + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v4.0.1 + with: + token: ${{ secrets.CODECOV_TOKEN }}