Skip to content

Commit

Permalink
chore(ci): minor improvements and cleanups (#171)
Browse files Browse the repository at this point in the history
Checkout code before setting up go:

The `setup-go` action caches by default.
This allows GH caches to work properly, and also to use the Go
version from the `go.mod` file.

Use 'with.go-version-file:' in 'actions/setup-go'.

Skip Go pkg cache since setup-go manages it.

Add names for steps.
  • Loading branch information
julio-lopez authored Sep 14, 2023
1 parent 50cd583 commit 10ed04d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@ jobs:
runs-on: ubuntu-latest
steps:

- name: Check out code
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0

- name: Set up Go
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version: ^1.19
id: go
go-version-file: 'go.mod'

- name: Check out code into the Go module directory
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
id: go

- name: Build
run: go build -v .
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: golangci-lint
name: Lint
on:
push:
tags:
Expand All @@ -12,13 +12,16 @@ jobs:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
- name: Checkout code
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
- name: Set up Go
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version: 1.19
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
go-version-file: 'go.mod'
- name: golangci-lint
uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc # v3.7.0
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.48
args: --timeout=5m --modules-download-mode=mod
skip-pkg-cache: true
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version: 1.19
go-version-file: 'go.mod'
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@7ec5c2b0c6cdda6e8bbb49444bc797dd33d74dd8 # v5.0.0
with:
Expand Down

0 comments on commit 10ed04d

Please sign in to comment.