Skip to content

Commit

Permalink
build: udpate go github action workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Stickel <ben.stickel@elastic.co>
  • Loading branch information
fin09pcap committed Dec 5, 2024
1 parent 5d50ab7 commit 79aa511
Showing 1 changed file with 22 additions and 23 deletions.
45 changes: 22 additions & 23 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ permissions:
actions: write

jobs:
# Check if there any dirty change for go mod tidy
# Check if there are any dirty change for go mod tidy
go-mod:
name: "Check go modules declaration"
runs-on: ubuntu-latest
Expand All @@ -38,28 +38,27 @@ jobs:
access_token: ${{ secrets.GITHUB_TOKEN }}
-
name: Install Go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: 1.19
go-version: 1.23
-
name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
-
name: Check go mod and go.sum
run: |
go mod tidy -v
git --no-pager diff go.mod go.sum
git --no-pager diff --quiet go.mod go.sum
# Try compile all binaries first
# Try to compile all binaries first
compile-dryrun:
name: "Compile"
strategy:
fail-fast: true
matrix:
go-version:
- "1.19"
- "1.18.10"
- "1.23.2"
runs-on: ubuntu-latest
needs: [golangci-lint, go-mod]
steps:
Expand All @@ -73,13 +72,13 @@ jobs:
uses: actions/checkout@v3
-
name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
check-latest: true
-
name: Cache Go modules
uses: actions/cache@v3.0.3
uses: actions/cache@v4.2.0
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
Expand Down Expand Up @@ -107,7 +106,7 @@ jobs:
name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: 1.23
-
uses: actions/checkout@v3
-
Expand All @@ -129,15 +128,15 @@ jobs:
access_token: ${{ secrets.GITHUB_TOKEN }}
-
name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
-
name: Install Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: 1.19
go-version: 1.23
-
name: Cache Go modules
uses: actions/cache@v3.0.3
uses: actions/cache@v4.2.0
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
Expand All @@ -148,9 +147,9 @@ jobs:
run: go mod download
-
name: Setup gotestsum
uses: autero1/action-gotestsum@v1.0.0
uses: autero1/action-gotestsum@v2.0.0
with:
gotestsum_version: 1.7.0
gotestsum_version: 1.12.0
-
name: Run tests
run: gotestsum --format short-verbose ./pkg/...
Expand All @@ -170,9 +169,9 @@ jobs:
uses: actions/checkout@v3
-
name: Install Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: 1.19
go-version: 1.23.2
-
name: Cache Go modules
uses: actions/cache@v3.0.3
Expand All @@ -186,9 +185,9 @@ jobs:
run: go mod download
-
name: Setup gotestsum
uses: autero1/action-gotestsum@v1.0.0
uses: autero1/action-gotestsum@v2.0.0
with:
gotestsum_version: 1.7.0
gotestsum_version: 1.12.0
-
name: Run tests
run: gotestsum --format short-verbose ./pkg/...
Expand All @@ -210,7 +209,7 @@ jobs:
name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: 1.23.2
-
name: Cache Go modules
uses: actions/cache@v3.0.3
Expand All @@ -224,9 +223,9 @@ jobs:
run: go mod download
-
name: Setup gotestsum
uses: autero1/action-gotestsum@v1.0.0
uses: autero1/action-gotestsum@v2.0.0
with:
gotestsum_version: 1.7.0
gotestsum_version: 1.12.0
-
name: Run tests
run: gotestsum --format short-verbose ./pkg/...

0 comments on commit 79aa511

Please sign in to comment.