Skip to content

Commit

Permalink
go1.23 support (#4836)
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez authored Aug 13, 2024
1 parent 9eeb891 commit 1147824
Show file tree
Hide file tree
Showing 15 changed files with 68 additions and 147 deletions.
36 changes: 10 additions & 26 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,49 +11,33 @@ jobs:
name: Build and deploy documentation
runs-on: ubuntu-latest
env:
GO_VERSION: '1.22'
# https://github.com/actions/setup-go#supported-version-syntax
# ex:
# - 1.18beta1 -> 1.18.0-beta.1
# - 1.18rc1 -> 1.18.0-rc.1
GO_VERSION: '1.23'
NODE_VERSION: '20.x'
CGO_ENABLED: 0

steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Go ${{ env.GO_VERSION }}
uses: actions/setup-go@v5
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

- name: Cache Go modules
uses: actions/cache@v4
with:
# In order:
# * Module download cache
# * Build cache (Linux)
path: |
~/go/pkg/mod
~/.cache/go-build
key: docs-${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
docs-${{ runner.os }}-go-
- run: go mod download

- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
cache-dependency-path: docs/package-lock.json

- run: go mod download

- run: npm install --legacy-peer-deps
working-directory: ./docs

- name: Build Documentation
run: npm run build
working-directory: ./docs
run: npm run build

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
Expand Down
33 changes: 11 additions & 22 deletions .github/workflows/post-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ jobs:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GOLANGCI_LINT_TOKEN }}
# https://github.com/actions/setup-go#supported-version-syntax
# ex:
# - 1.18beta1 -> 1.18.0-beta.1
# - 1.18rc1 -> 1.18.0-rc.1
GO_VERSION: '1.23'
steps:
- uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
- uses: actions/setup-go@v5
with:
# https://github.com/actions/setup-go#supported-version-syntax
# ex:
# - 1.18beta1 -> 1.18.0-beta.1
# - 1.18rc1 -> 1.18.0-rc.1
go-version: '1.22'
go-version: ${{ env.GO_VERSION }}
- uses: actions/setup-node@v4
with:
node-version: "15"
Expand Down Expand Up @@ -49,14 +49,9 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GOLANGCI_LINT_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
- uses: actions/setup-go@v5
with:
# https://github.com/actions/setup-go#supported-version-syntax
# ex:
# - 1.18beta1 -> 1.18.0-beta.1
# - 1.18rc1 -> 1.18.0-rc.1
go-version: '1.22'
go-version: ${{ env.GO_VERSION }}

- name: Update GitHub Action config
run: make assets/github-action-config.json
Expand All @@ -77,14 +72,9 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GOLANGCI_LINT_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
- uses: actions/setup-go@v5
with:
# https://github.com/actions/setup-go#supported-version-syntax
# ex:
# - 1.18beta1 -> 1.18.0-beta.1
# - 1.18rc1 -> 1.18.0-rc.1
go-version: '1.22'
go-version: ${{ env.GO_VERSION }}

- name: Update reference files
run: cp .golangci.next.reference.yml .golangci.reference.yml
Expand All @@ -110,6 +100,5 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}

steps:
- run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b "./install-golangci-lint"
33 changes: 9 additions & 24 deletions .github/workflows/pr-documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,43 +9,28 @@ jobs:
name: Build documentation
runs-on: ubuntu-latest
env:
GO_VERSION: '1.22'
# https://github.com/actions/setup-go#supported-version-syntax
# ex:
# - 1.18beta1 -> 1.18.0-beta.1
# - 1.18rc1 -> 1.18.0-rc.1
GO_VERSION: '1.23'
NODE_VERSION: '20.x'
CGO_ENABLED: 0

steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Go ${{ env.GO_VERSION }}
uses: actions/setup-go@v5
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

- name: Cache Go modules
uses: actions/cache@v4
with:
# In order:
# * Module download cache
# * Build cache (Linux)
path: |
~/go/pkg/mod
~/.cache/go-build
key: docs-${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
docs-${{ runner.os }}-go-
- run: go mod download

- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
cache-dependency-path: docs/package-lock.json

- run: go mod download

- run: npm install --legacy-peer-deps
working-directory: ./docs

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-extra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
# ex:
# - 1.18beta1 -> 1.18.0-beta.1
# - 1.18rc1 -> 1.18.0-rc.1
go-version: '1.22'
go-version: '1.23'
- name: Run go list
run: go list -json -m all > go.list
- name: Nancy
Expand Down
74 changes: 21 additions & 53 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,21 @@ on:
pull_request:

env:
GO_VERSION: '1.22'
# https://github.com/actions/setup-go#supported-version-syntax
# ex:
# - 1.18beta1 -> 1.18.0-beta.1
# - 1.18rc1 -> 1.18.0-rc.1
GO_VERSION: '1.23'

jobs:
# Check if there is any dirty change for go mod tidy
go-mod:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v5
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
# https://github.com/actions/setup-go#supported-version-syntax
# ex:
# - 1.18beta1 -> 1.18.0-beta.1
# - 1.18rc1 -> 1.18.0-rc.1
go-version: ${{ env.GO_VERSION }}
- name: Checkout code
uses: actions/checkout@v4
- name: Check go mod
run: |
go mod tidy
Expand All @@ -35,14 +33,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
- uses: actions/setup-go@v5
with:
# https://github.com/actions/setup-go#supported-version-syntax
# ex:
# - 1.18beta1 -> 1.18.0-beta.1
# - 1.18rc1 -> 1.18.0-rc.1
go-version: ${{ env.GO_VERSION }}
# TODO(ldez) must be changed after the first release of golangci-lint with go1.23
# go-version: ${{ env.GO_VERSION }}
go-version: '1.22'
- name: lint
uses: golangci/[email protected]
with:
Expand All @@ -53,13 +52,8 @@ jobs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
- uses: actions/setup-go@v5
with:
# https://github.com/actions/setup-go#supported-version-syntax
# ex:
# - 1.18beta1 -> 1.18.0-beta.1
# - 1.18rc1 -> 1.18.0-rc.1
go-version: ${{ env.GO_VERSION }} # test only the latest go version to speed up CI
- name: Run tests
run: make.exe test
Expand All @@ -69,13 +63,8 @@ jobs:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
- uses: actions/setup-go@v5
with:
# https://github.com/actions/setup-go#supported-version-syntax
# ex:
# - 1.18beta1 -> 1.18.0-beta.1
# - 1.18rc1 -> 1.18.0-rc.1
go-version: ${{ env.GO_VERSION }} # test only the latest go version to speed up CI
- name: Run tests
run: make test
Expand All @@ -86,43 +75,27 @@ jobs:
strategy:
matrix:
golang:
- '1.21'
- '1.22'
- '1.23'
steps:
- uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
- uses: actions/setup-go@v5
with:
# https://github.com/actions/setup-go#supported-version-syntax
# ex:
# - 1.18beta1 -> 1.18.0-beta.1
# - 1.18rc1 -> 1.18.0-rc.1
go-version: ${{ matrix.golang }}
- uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ matrix.golang }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-${{ matrix.golang }}-
- name: Run tests
run: make test

# Checks: GitHub action assets
check_generated:
needs: golangci-lint # run after golangci-lint action to not produce duplicated errors
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Unshallow
run: git fetch --prune --unshallow
- name: Install Go
uses: actions/setup-go@v5
with:
# https://github.com/actions/setup-go#supported-version-syntax
# ex:
# - 1.18beta1 -> 1.18.0-beta.1
# - 1.18rc1 -> 1.18.0-rc.1
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Check generated files are up to date
- name: Check generated files are up-to-date
run: make fast_check_generated
env:
# needed for github-action-config.json generation
Expand All @@ -145,13 +118,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
- uses: actions/setup-go@v5
with:
# https://github.com/actions/setup-go#supported-version-syntax
# ex:
# - 1.18beta1 -> 1.18.0-beta.1
# - 1.18rc1 -> 1.18.0-rc.1
go-version: ${{ env.GO_VERSION }}
- name: Build golangci-lint
run: make build
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,15 @@ jobs:
# ex:
# - 1.18beta1 -> 1.18.0-beta.1
# - 1.18rc1 -> 1.18.0-rc.1
GO_VERSION: '1.22'
GO_VERSION: '1.23'
CHOCOLATEY_VERSION: 2.2.0
steps:
- uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Unshallow
run: git fetch --prune --unshallow

- name: Install chocolatey
run: |
Expand Down
3 changes: 2 additions & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
version: 2

project_name: golangci-lint

builds:
Expand Down
2 changes: 1 addition & 1 deletion build/buildx-alpine.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# syntax=docker/dockerfile:1.4
FROM golang:1.22-alpine
FROM golang:1.23-alpine

# related to https://github.com/golangci/golangci-lint/issues/3107
ENV GOROOT /usr/local/go
Expand Down
2 changes: 1 addition & 1 deletion build/buildx.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# syntax=docker/dockerfile:1.4
FROM golang:1.22
FROM golang:1.23

# related to https://github.com/golangci/golangci-lint/issues/3107
ENV GOROOT /usr/local/go
Expand Down
Loading

0 comments on commit 1147824

Please sign in to comment.