From 78187d9f66d50655745460b8cc0246d28bf54186 Mon Sep 17 00:00:00 2001 From: Marcel Meyer Date: Thu, 14 Nov 2024 19:41:12 +0100 Subject: [PATCH 1/2] Update GitHub actions * actions/checkout v4 is available * actions/setup-go v5 is availabe, v4+ has an integrated cache * Caching in ci.yml was removed * Caching in go-cross.yml was not touched because more stuff is cached * actions/cache v4 is available * golangci/golangci-lint-action is available and has CI optimized caching integrated * Go 1.23 (current stable) can check clean dependencies with `go mod tidy -diff` * actions/go-dependency-submission v2 is available --- .github/workflows/ci.yml | 32 +++++++++----------------------- .github/workflows/deps.yml | 6 +++--- .github/workflows/go-cross.yml | 4 ++-- .github/workflows/release.yml | 4 ++-- 4 files changed, 16 insertions(+), 30 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3ed67cf..4537ede 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,42 +14,28 @@ jobs: runs-on: ubuntu-latest env: GO_VERSION: "stable" - GOLANGCI_LINT_VERSION: v1.61.0 + GOLANGCI_LINT_VERSION: v1.62.0 CGO_ENABLED: 0 steps: - name: Set up Go ${{ env.GO_VERSION }} - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version: ${{ env.GO_VERSION }} - name: Check out code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Cache Go modules - uses: actions/cache@v3 - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- - - name: Check and get dependencies - run: | - go mod tidy - git diff --exit-code go.mod - git diff --exit-code go.sum - - - name: Install golangci-lint ${{ env.GOLANGCI_LINT_VERSION }} - run: | - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin ${GOLANGCI_LINT_VERSION} - golangci-lint --version - - - name: Lint - run: golangci-lint run + run: go mod tidy -diff + + - name: golangci-lint action ${{ env.GOLANGCI_LINT_VERSION }} + uses: golangci/golangci-lint-action@v6 + with: + version: ${{ env.GOLANGCI_LINT_VERSION }} - name: Test run: go test -v -cover ./... diff --git a/.github/workflows/deps.yml b/.github/workflows/deps.yml index 699ae99..ce0ec97 100644 --- a/.github/workflows/deps.yml +++ b/.github/workflows/deps.yml @@ -12,10 +12,10 @@ jobs: main: 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: "stable" - - uses: actions/go-dependency-submission@v1 + - uses: actions/go-dependency-submission@v2 with: go-mod-path: go.mod diff --git a/.github/workflows/go-cross.yml b/.github/workflows/go-cross.yml index 3c9cda9..fb09817 100644 --- a/.github/workflows/go-cross.yml +++ b/.github/workflows/go-cross.yml @@ -22,12 +22,12 @@ jobs: steps: - name: Set up Go ${{ matrix.go-version }} - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version: ${{ matrix.go-version }} - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Cache Go modules uses: actions/cache@v3 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 815f433..557df90 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,13 +12,13 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Set up Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version: "stable" From f5996769ea02f52bdb5710a3fab108ef825d28dc Mon Sep 17 00:00:00 2001 From: Marcel Meyer Date: Sat, 16 Nov 2024 15:36:43 +0100 Subject: [PATCH 2/2] Remove specific patch version from golangci-lint --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4537ede..b64a7b8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest env: GO_VERSION: "stable" - GOLANGCI_LINT_VERSION: v1.62.0 + GOLANGCI_LINT_VERSION: v1.62 CGO_ENABLED: 0 steps: