From 579f5cf899584a59b78adf459e6121a61cf0925a Mon Sep 17 00:00:00 2001 From: Jordan Krage Date: Fri, 5 Apr 2024 01:06:59 -0500 Subject: [PATCH] run go work sync & go mod tidy; add workflow step to keep updated (#36) * 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 --- .github/workflows/go.yaml | 20 ++++++++++++++++---- go/go.work | 4 +++- go/tdh2/go.mod | 10 +++++++++- go/tdh2/go.sum | 8 ++++++++ 4 files changed, 36 insertions(+), 6 deletions(-) diff --git a/.github/workflows/go.yaml b/.github/workflows/go.yaml index 82727e4..a33d266 100644 --- a/.github/workflows/go.yaml +++ b/.github/workflows/go.yaml @@ -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 @@ -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 @@ -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 }} diff --git a/go/go.work b/go/go.work index ae05aef..6f9267c 100644 --- a/go/go.work +++ b/go/go.work @@ -1,4 +1,6 @@ -go 1.19 +go 1.20 + +toolchain go1.21.7 use ( ./ocr2/decryptionplugin diff --git a/go/tdh2/go.mod b/go/tdh2/go.mod index a009da5..5a81f01 100644 --- a/go/tdh2/go.mod +++ b/go/tdh2/go.mod @@ -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 +) diff --git a/go/tdh2/go.sum b/go/tdh2/go.sum index 62841cd..85c4afe 100644 --- a/go/tdh2/go.sum +++ b/go/tdh2/go.sum @@ -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=