Skip to content

Commit

Permalink
Update GitHub actions
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
mrclmr committed Nov 14, 2024
1 parent b730bf5 commit 78187d9
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 30 deletions.
32 changes: 9 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 ./...
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions .github/workflows/go-cross.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down

0 comments on commit 78187d9

Please sign in to comment.