fix: linting on go 1.23 #649
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [master] | |
pull_request: ~ | |
workflow_dispatch: ~ | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: '1.23' | |
# install must occur in the same step as the linter to run properly on CI | |
- name: Lint project | |
run: make 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'] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: run tests | |
run: EASYPOST_TEST_API_KEY=123 EASYPOST_PROD_API_KEY=123 make install test | |
coverage: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: '1.19' # TODO: There is a bug in 1.20 that isn't calculating coverage correctly | |
- name: Run coverage report | |
run: EASYPOST_TEST_API_KEY=123 EASYPOST_PROD_API_KEY=123 make install coverage | |
coveralls: | |
if: github.ref == 'refs/heads/master' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
# NOTE: goveralls is not compatibile with go v1.22+, must remain on v1.21 max | |
go-version: '1.19' # TODO: There is a bug in 1.20 that isn't calculating coverage correctly | |
- name: Run coverage report | |
run: EASYPOST_TEST_API_KEY=123 EASYPOST_PROD_API_KEY=123 make install coverage | |
- name: Install goveralls | |
env: | |
GO111MODULE: off | |
run: go get github.com/mattn/goveralls | |
- name: Coveralls | |
env: | |
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: goveralls -coverprofile=covprofile -service=github |