diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 23472eb..a5a08d5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,15 +14,15 @@ jobs: - uses: extractions/setup-just@v3 - uses: actions/setup-go@v6 with: + # TODO: The version of golangci-lint we use is not compatible with Go 1.26+, migrate to new version go-version: '1.25' - # install must occur in the same step as the linter to run properly on CI - name: Lint project run: just install lint build: runs-on: ubuntu-latest strategy: matrix: - go-version: ['1.16', '1.17', '1.18', '1.19', '1.20', '1.21', '1.22', '1.23', '1.24', '1.25'] + go-version: ['1.16', '1.17', '1.18', '1.19', '1.20', '1.21', '1.22', '1.23', '1.24', '1.25', '1.26'] steps: - uses: actions/checkout@v6 - uses: extractions/setup-just@v3 @@ -38,24 +38,11 @@ jobs: - uses: extractions/setup-just@v3 - uses: actions/setup-go@v6 with: - go-version: '1.25' - - name: Run coverage report + go-version: '1.26' + - name: Run tests run: EASYPOST_TEST_API_KEY=123 EASYPOST_PROD_API_KEY=123 just install coverage - coveralls: - if: github.ref == 'refs/heads/master' - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - - uses: extractions/setup-just@v3 - - uses: actions/setup-go@v6 + - name: Coverage + if: github.ref == 'refs/heads/master' + uses: codecov/codecov-action@v5 with: - # NOTE: goveralls is not compatibile with go v1.22+, must remain on v1.21 max - go-version: '1.21' - - name: Run coverage report - run: EASYPOST_TEST_API_KEY=123 EASYPOST_PROD_API_KEY=123 just install coverage - - name: Install goveralls - run: go install github.com/mattn/goveralls@latest - - name: Coveralls - env: - COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: goveralls -coverprofile=covprofile -service=github + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/README.md b/README.md index 569d94a..7f74a73 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # EasyPost Go Client Library [![CI](https://github.com/EasyPost/easypost-go/workflows/CI/badge.svg)](https://github.com/EasyPost/easypost-go/actions?query=workflow%3ACI) -[![Coverage Status](https://coveralls.io/repos/github/EasyPost/easypost-go/badge.svg?branch=master)](https://coveralls.io/github/EasyPost/easypost-go?branch=master) +[![codecov](https://codecov.io/gh/EasyPost/easypost-go/graph/badge.svg?token=BW6X4DO2FT)](https://codecov.io/gh/EasyPost/easypost-go) [![GitHub version](https://badge.fury.io/gh/EasyPost%2Feasypost-go.svg)](https://badge.fury.io/gh/EasyPost%2Feasypost-go) [![GoDoc](https://godoc.org/github.com/EasyPost/easypost-go?status.svg)](https://pkg.go.dev/github.com/EasyPost/easypost-go) diff --git a/justfile b/justfile index 7d13c0e..3d4232a 100644 --- a/justfile +++ b/justfile @@ -10,9 +10,9 @@ clean: # Get test coverage and open it in a browser coverage: go clean -testcache - go test -coverprofile=covprofile ./... - bash -c 'statement_cov=$(go tool cover -func=covprofile | grep total: | awk "{print substr(\$NF, 1, length(\$NF)-1)}"); if [ $(echo "$statement_cov < 78.0" | bc) -eq 1 ]; then echo "Tests passed but statement coverage failed with coverage: $statement_cov"; exit 1; fi' - go tool cover -html=covprofile + go test -coverprofile=cover.out ./... + bash -c 'statement_cov=$(go tool cover -func=cover.out | grep total: | awk "{print substr(\$NF, 1, length(\$NF)-1)}"); if [ $(echo "$statement_cov < 78.0" | bc) -eq 1 ]; then echo "Tests passed but statement coverage failed with coverage: $statement_cov"; exit 1; fi' + go tool cover -html=cover.out # Initialize the examples submodule init-examples-submodule: