diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 43b81c4..c842fa7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,12 +8,18 @@ on: branches: - "*" +concurrency: + # Cancel any previous workflows if they are from a PR or push. + group: ${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + defaults: run: shell: bash env: - GO_VERSION: 1.23.9 + GO_VERSION: 1.24.10 + LINT_VERSION: v2.6.2 jobs: ######################## @@ -28,18 +34,15 @@ jobs: with: fetch-depth: 0 - - name: create linter cache directory - run: mkdir -p /tmp/go-lint-cache - - - name: linter cache - uses: actions/cache@v4 + - name: setup go ${{ env.GO_VERSION }} + uses: actions/setup-go@v5 with: - path: | - /tmp/go-lint-cache - key: ${{ runner.os }}-go-${{ env.GO_VERSION }}-linter-${{ hashFiles('**/go.sum') }} + go-version: '${{ env.GO_VERSION }}' - - name: lint - run: make lint + - name: golangci-lint + uses: golangci/golangci-lint-action@v9 + with: + version: '${{ env.LINT_VERSION }}' ######################## # run unit tests diff --git a/.golangci.yml b/.golangci.yml index 5dddc30..153d385 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -41,11 +41,9 @@ linters: settings: govet: - # Don't report about shadowed variables. - shadow: false - gofmt: - # simplify code: gofmt with `-s` option, true by default. - simplify: true + disable: + # Don't report about shadowed variables. + - shadow whitespace: multi-func: true multi-if: true diff --git a/Dockerfile b/Dockerfile index 316f2c6..ecfea0f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Start with a Golang builder image. -FROM golang:1.24.6-alpine3.22@sha256:c8c5f95d64aa79b6547f3b626eb84b16a7ce18a139e3e9ca19a8c078b85ba80d AS golangbuilder +FROM golang:1.24.10-alpine3.22@sha256:12c199a889439928e36df7b4c5031c18bfdad0d33cdeae5dd35b2de369b5fbf5 AS golangbuilder # Pass a tag, branch or a commit using build-arg. This allows a docker image to # be built from a specified Git state.