Skip to content

Commit

Permalink
github/workflows: migrate CI to Go 1.19 and fix linting issues (#2426)
Browse files Browse the repository at this point in the history
  • Loading branch information
fsouza authored Nov 14, 2022
1 parent beef59d commit 9aa9e74
Show file tree
Hide file tree
Showing 54 changed files with 157 additions and 125 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.17.0
go-version: 1.19.x
- name: Set up Node
uses: actions/setup-node@v3
with:
Expand All @@ -36,6 +36,6 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.17.0
go-version: 1.19.x
- name: lint
run: make api-lint
21 changes: 12 additions & 9 deletions .github/workflows/backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,23 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
id: setup-go
with:
go-version: 1.17.0
go-version: 1.19.x
- name: go mod cache
uses: actions/cache@v3
with:
path: |
~/go/pkg/mod
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
key: ${{ runner.os }}-${{ steps.setup-go.outputs.go-version }}-go-mod-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-mod-
- name: go build cache
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}
key: ${{ runner.os }}-${{ steps.setup-go.outputs.go-version }}-go-build-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-build-
- run: make backend
Expand All @@ -41,22 +42,23 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
id: setup-go
with:
go-version: 1.17.0
go-version: 1.19.x
- name: go mod cache
uses: actions/cache@v3
with:
path: |
~/go/pkg/mod
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
key: ${{ runner.os }}-${{ steps.setup-go.outputs.go-version }}-go-mod-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-mod-
- name: go test cache
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
key: ${{ runner.os }}-go-test-${{ hashFiles('**/go.sum') }}
key: ${{ runner.os }}-${{ steps.setup-go.outputs.go-version }}-go-test-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-test-
- run: make backend-test
Expand All @@ -73,14 +75,15 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
id: setup-go
with:
go-version: 1.17.0
go-version: 1.19.x
- name: go mod cache
uses: actions/cache@v3
with:
path: |
~/go/pkg/mod
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
key: ${{ runner.os }}-${{ steps.setup-go.outputs.go-version }}-go-mod-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-mod-
- name: go lint cache
Expand All @@ -89,7 +92,7 @@ jobs:
path: |
~/.cache/go-build
~/.cache/golangci-lint
key: ${{ runner.os }}-go-lint-${{ hashFiles('**/go.sum') }}
key: ${{ runner.os }}-${{ steps.setup-go.outputs.go-version }}-go-lint-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-lint-
- run: make backend-lint
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
VERSION=latest
TAGS="${DOCKER_IMAGE}:${VERSION}"
TAGS="$TAGS,${DOCKER_IMAGE}:sha-${GITHUB_SHA::7}"
echo ::set-output name=tags::${TAGS}
echo "tags=${TAGS}" >>${GITHUB_OUTPUT}
- name: build and push
if: github.ref == 'refs/heads/main'
uses: docker/[email protected]
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,9 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
id: setup-go
with:
go-version: 1.17.0
go-version: 1.19.x
- uses: actions/setup-node@v3
with:
node-version: '16.x'
Expand All @@ -108,15 +109,15 @@ jobs:
with:
path: |
~/go/pkg/mod
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
key: ${{ runner.os }}-${{ steps.setup-go.outputs.go-version }}-go-mod-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-mod-
- name: go build cache
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
key: ${{ runner.os }}-go-mock-build-${{ hashFiles('**/go.sum') }}
key: ${{ runner.os }}-${{ steps.setup-go.outputs.go-version }}-go-mock-build-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-mock-build-
${{ runner.os }}-go-build-
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scaffolding.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
path: ${{ env.PACKAGEPATH }}
- uses: actions/setup-go@v3
with:
go-version: 1.17.0
go-version: 1.19.x
- uses: actions/setup-node@v3
with:
node-version: '16.x'
Expand Down
11 changes: 5 additions & 6 deletions backend/.golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,28 @@
linters:
disable-all: true
enable:
- deadcode
- errcheck
- exportloopref
- gci
- gocritic
- gofmt
- goimports
- gosec
- gosimple
- govet
- ineffassign
- staticcheck
- structcheck
- typecheck
- unused
- varcheck
- whitespace
linters-settings:
gocritic:
disabled-checks:
- singleCaseSwitch
goimports:
local-prefixes: github.com/lyft/clutch/backend
gci:
sections:
- standard
- default
- prefix(github.com/lyft/clutch/backend)
issues:
max-per-linter: 0
max-same-issues: 0
Expand Down
2 changes: 2 additions & 0 deletions backend/api/audit/v1/audit.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions backend/api/authn/v1/authn.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions backend/api/chaos/experimentation/v1/properties.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions backend/api/config/gateway/v1/gateway.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions backend/api/config/middleware/accesslog/v1/accesslog.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions backend/api/config/module/featureflag/v1/featureflag.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions backend/api/config/service/audit/v1/audit.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 12 additions & 13 deletions backend/api/config/service/auditsink/slack/v1/slack.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions backend/api/config/service/authn/v1/authn.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions backend/api/config/service/authz/v1/authz.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions backend/api/config/service/db/postgres/v1/database.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9aa9e74

Please sign in to comment.