From 3c57d871dde7b5bb1528c2f7fc47004793ff8860 Mon Sep 17 00:00:00 2001 From: Rick Lane Date: Tue, 25 Jun 2024 01:24:44 -0400 Subject: [PATCH] Update to Go 1.22 Signed-off-by: Rick Lane --- .dockerignore | 1 - .github/workflows/qa.yml | 23 +- .github/workflows/test-action.yml | 16 +- Makefile | 7 - build-aux/docker/go_builder.dockerfile | 2 +- build-aux/docker/js_builder.dockerfile | 2 +- build-aux/docker/py_builder.dockerfile | 2 +- go.mod | 2 +- tools/.gitignore | 1 - tools/src/golangci-lint/go.mod | 183 ----- tools/src/golangci-lint/go.sum | 976 ------------------------- tools/src/golangci-lint/pin.go | 6 - 12 files changed, 24 insertions(+), 1197 deletions(-) delete mode 100644 tools/.gitignore delete mode 100644 tools/src/golangci-lint/go.mod delete mode 100644 tools/src/golangci-lint/go.sum delete mode 100644 tools/src/golangci-lint/pin.go diff --git a/.dockerignore b/.dockerignore index 6f93c31..b949736 100644 --- a/.dockerignore +++ b/.dockerignore @@ -7,4 +7,3 @@ DEPENDENCY_LICENSES.md .git .github actions -tools diff --git a/.github/workflows/qa.yml b/.github/workflows/qa.yml index 4accf60..7d00d35 100644 --- a/.github/workflows/qa.yml +++ b/.github/workflows/qa.yml @@ -11,13 +11,11 @@ jobs: - macos-latest #- windows-latest go_version: - - '1.18.0' - - '1.19.0' - - '1.20.0' - '1.21.0' + - '1.22.0' steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: go-version: '~${{ matrix.go_version }}' cache: true @@ -25,23 +23,26 @@ jobs: if [[ "${{runner.debug}}" == "1" ]]; then DEBUG_FLAGS="-v" fi - + go test -race ${DEBUG_FLAGS} ./... lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: # Specify the most recent (1.Y.Z) Y release go-version-file: go.mod cache: true - - run: make lint + - uses: golangci/golangci-lint-action@v5 + with: + version: latest + args: --timeout=10m generate: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: go-version-file: go.mod cache: true diff --git a/.github/workflows/test-action.yml b/.github/workflows/test-action.yml index 5cf4c9f..3c73b8a 100644 --- a/.github/workflows/test-action.yml +++ b/.github/workflows/test-action.yml @@ -12,12 +12,12 @@ jobs: name: "Generate dependency information" runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - name: Setup Go environment - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: go-version-file: go.mod cache: true @@ -37,14 +37,14 @@ jobs: : > DEPENDENCY_LICENSES.md : > DEPENDENCIES.md git add DEPENDENCY_LICENSES.md DEPENDENCIES.md - + # Generate license information export GO_IMAGE=$(grep -e 'FROM golang:' "build-aux/docker/go_builder.dockerfile" | cut -d ' ' -f2 ) #Copy test data to another folder since it can't be used from there cp -a ./test-data ./ui export NPM_PACKAGES=$( echo -e "./ui/package.json\n./ui/package-lock.json" ) - + mkdir -p "${BUILD_TMP}" build-aux/generate.sh --unparsable-packages ./unparsable-packages.yaml @@ -58,7 +58,7 @@ jobs: - name: "Check that action didn't do any changes" run: | if [[ "${{ steps.changed-by-dependabot.outputs.is_dirty }}" == 'true' ]]; then - echo "::error:: Action indicates that the repo was dirty" + echo "::error:: Action indicates that the repo was dirty" exit 1 fi @@ -74,18 +74,18 @@ jobs: if: github.ref_type == 'branch' run: | if [[ "${{ steps.changed-by-dependabot2.outputs.license_information_committed }}" != 'true' ]]; then - echo "::error:: Action indicates that the repo was not dirty" + echo "::error:: Action indicates that the repo was not dirty" exit 1 fi DESTINATION_BRANCH="${GITHUB_HEAD_REF:-$GITHUB_REF_NAME}" DIFF=$(git diff --stat --cached origin/${DESTINATION_BRANCH}) if [[ -z "${DIFF}" ]]; then - echo "::error:: There weren't any files committed." + echo "::error:: There weren't any files committed." exit 1 fi if ! grep -e '^\s*DEPENDENCY_LICENSES.md' <(echo "${DIFF}") > /dev/null; then - echo "::error:: File DEPENDENCY_LICENSES.md was not modified, but it should have been." + echo "::error:: File DEPENDENCY_LICENSES.md was not modified, but it should have been." exit 1 fi diff --git a/Makefile b/Makefile index 379afe7..f26e6c1 100644 --- a/Makefile +++ b/Makefile @@ -13,13 +13,6 @@ generate: go generate ./... .PHONY: generate -lint: tools/bin/golangci-lint - tools/bin/golangci-lint run ./... -.PHONY: lint - -tools/bin/%: tools/src/%/pin.go tools/src/%/go.mod - cd $(