Skip to content

Commit

Permalink
run go work sync & go mod tidy; add workflow step to keep updated (#36)
Browse files Browse the repository at this point in the history
* add workflow step to keep deps synced & tidy

* go work sync; go mod tidy

* bump golangci-lint v1.57.2

* bump sonar v2.0.1
  • Loading branch information
jmank88 authored Apr 5, 2024
1 parent 9e478e5 commit 579f5cf
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 6 deletions.
20 changes: 16 additions & 4 deletions .github/workflows/go.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'
go-version: '1.21'

- name: Install golangci-lint
run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.53.3
run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.57.2

# go.work makes it necessary to find go.mod files to run linter in the corresponding dirs
- name: Run golangci-lint
Expand Down Expand Up @@ -46,7 +46,19 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'
go-version: '1.21'

- name: Ensure dependencies synced & tidy
working-directory: ./go
run: |
go work sync
pushd tdh2
go mod tidy
popd
pushd ocr2/decryptionplugin
go mod tidy
popd
git diff --minimal --exit-code
- name: Build and test OCR2 plugin
working-directory: ./go/ocr2/decryptionplugin
Expand Down Expand Up @@ -104,7 +116,7 @@ jobs:
echo "sonarqube_golangci_report_paths=$(find -type f -name 'golangci-lint-report.xml' -printf "%p,")" >> $GITHUB_OUTPUT
- name: SonarQube Scan
uses: sonarsource/sonarqube-scan-action@v1.2.0
uses: sonarsource/sonarqube-scan-action@69c1a75940dec6249b86dace6b630d3a2ae9d2a7 # v2.0.1
with:
args: >
-Dsonar.go.coverage.reportPaths=${{ steps.sonarqube_report_paths.outputs.sonarqube_coverage_report_paths }}
Expand Down
4 changes: 3 additions & 1 deletion go/go.work
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
go 1.19
go 1.20

toolchain go1.21.7

use (
./ocr2/decryptionplugin
Expand Down
10 changes: 9 additions & 1 deletion go/tdh2/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,12 @@ module github.com/smartcontractkit/tdh2/go/tdh2

go 1.19

require github.com/google/go-cmp v0.5.9
require (
github.com/google/go-cmp v0.5.9
github.com/stretchr/testify v1.3.0
)

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
)
8 changes: 8 additions & 0 deletions go/tdh2/go.sum
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=

0 comments on commit 579f5cf

Please sign in to comment.