Skip to content

Commit

Permalink
ci: update workflows to work with Go v1.21
Browse files Browse the repository at this point in the history
  • Loading branch information
jeronimoalbi committed Nov 11, 2023
1 parent bc15378 commit 10bbf01
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 23 deletions.
28 changes: 16 additions & 12 deletions .github/workflows/test-lint.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
name: Lint
on:
pull_request:
paths-ignore:
- '**.md'
push:
paths-ignore:
- '**.md'
branches:
- master
- develop
Expand All @@ -11,21 +15,21 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 6
steps:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
- uses: actions/checkout@v2
- uses: technote-space/get-diff-action@v4
- uses: actions/checkout@v3.4.0
- uses: technote-space/get-diff-action@v6.1.2
with:
PATTERNS: |
**/**.go
**/*.go
go.mod
go.sum
- uses: golangci/golangci-lint-action@master
- uses: actions/setup-go@v4
if: env.GIT_DIFF
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.49
args: --issues-exit-code=0 -e SA1019 --timeout 10m
github-token: ${{ secrets.github_token }}
go-version: '1.21'
- uses: golangci/golangci-lint-action@v3
if: env.GIT_DIFF
with:
version: v1.52.1
install-mode: goinstall
args: --timeout 10m
github-token: ${{ secrets.github_token }}
23 changes: 12 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,26 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: actions/cache@v2
- uses: actions/checkout@v3.4.0
- uses: technote-space/get-diff-action@v6.1.2
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
PATTERNS: |
**/*.go
go.mod
go.sum
- uses: actions/setup-go@v3
- uses: actions/setup-go@v4
if: env.GIT_DIFF
with:
go-version: 1.19
go-version: '1.21'

- name: Run unit tests
if: env.GIT_DIFF
run: |
go test -v -coverprofile=coverage.txt -covermode=atomic -coverpkg=./... $(go list ./...)
- name: filter non-testable files
if: env.GIT_DIFF
run: |
excludelist="$(find ./ -type f -name '*.go' | xargs grep -l 'DONTCOVER' || true)"
excludelist+=" $(find ./ -type f -name '*.pb.go')"
Expand All @@ -48,6 +48,7 @@ jobs:
done
- name: Upload coverage to Codecov
if: env.GIT_DIFF
uses: codecov/codecov-action@v3.1.1
with:
file: ./coverage.txt
Expand Down

0 comments on commit 10bbf01

Please sign in to comment.