diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 02d4152..7c41818 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,9 +7,7 @@ on: branches: [master] permissions: - contents: write - checks: write - pull-requests: write + contents: read jobs: test: @@ -21,25 +19,27 @@ jobs: with: go-version-file: go.mod + - name: Install gotestsum + run: go install gotest.tools/gotestsum@latest + - name: Build run: go build ./... - name: Test - run: go test -race -coverprofile=coverage.out -covermode=atomic -json ./... > test-report.json + run: gotestsum --junitfile test-results.xml -- -race -coverprofile=coverage.out -covermode=atomic ./... - - name: Test report + - name: Upload to Codecov if: always() - uses: dorny/test-reporter@v3 + uses: codecov/codecov-action@v5 with: - name: Go Tests - path: test-report.json - reporter: golang-json + files: coverage.out + token: ${{ secrets.CODECOV_TOKEN }} - - name: Upload coverage + - name: Upload test results to Codecov if: always() - uses: codecov/codecov-action@v5 + uses: codecov/test-results-action@v1 with: - files: coverage.out + files: test-results.xml token: ${{ secrets.CODECOV_TOKEN }} - name: Vet