diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e506874..f9fe738 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,33 +13,58 @@ jobs: go-version: [ "1.23", "1.24" ] runs-on: ubuntu-latest env: - GOLANGCI_LINT_VERSION: v2.1.5 + GOLANGCI_LINT_VERSION: v2.1.6 steps: - name: Checkout code uses: actions/checkout@v4 - name: Install Go - if: success() + id: install-go uses: actions/setup-go@v5 with: go-version: ${{ matrix.go-version }} + - name: Download dependencies + run: go mod download + if: steps.install-go.outputs.cache-hit != 'true' + - name: Run linter uses: golangci/golangci-lint-action@v8 with: version: ${{ env.GOLANGCI_LINT_VERSION }} - - name: Run tests - run: go test -covermode=count -coverprofile=coverage.out ./... + - name: Setup gotestsum + uses: gertd/action-gotestsum@v3.0.0 + with: + gotestsum_version: v1.12.0 + + - name: Run Tests + run: gotestsum --junitfile tests.xml --format pkgname -- -covermode=atomic -coverprofile=coverage.out -race ./... - - name: Convert coverage.out to coverage.lcov - uses: jandelgado/gcov2lcov-action@v1 + - name: Test Summary + uses: test-summary/action@v2 + with: + paths: "tests.xml" + if: always() - name: Coveralls uses: coverallsapp/github-action@v2 with: github-token: ${{ secrets.GITHUB_TOKEN }} + files: coverage.out + format: golang parallel: true flag-name: go-${{ matrix.go-version }} - path-to-lcov: coverage.lcov + + finish: + needs: test + if: ${{ always() }} + runs-on: ubuntu-latest + + steps: + - name: Coveralls Finished + uses: coverallsapp/github-action@v2 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + parallel-finished: true