Skip to content

Commit

Permalink
chore(gha): fix macos action/setup-go@v4 cache miss.
Browse files Browse the repository at this point in the history
Set the same Go version as specified in the `go.mod`
because of the issue below:
- actions/setup-go#424

Additionally, the rand.Seed() was updated to use
rand.New(rand.NewSource(seed)) because the former was
removed from Go1.20.

Signed-off-by: Tiago Natel <t.nateldemoura@gmail.com>
  • Loading branch information
i4ki committed Feb 2, 2024
1 parent 017241e commit 71f30ad
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/benchmark.yml
Expand Up @@ -20,7 +20,7 @@ jobs:
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
fetch-depth: 0
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: '1.20'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-experimental.yml
Expand Up @@ -28,7 +28,7 @@ jobs:
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
fetch-depth: 0
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Expand Up @@ -15,7 +15,7 @@ jobs:
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
fetch-depth: 0
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: '1.20'

Expand Down Expand Up @@ -49,7 +49,7 @@ jobs:
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
fetch-depth: 0
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}

Expand Down Expand Up @@ -79,7 +79,7 @@ jobs:
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
fetch-depth: 0
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: '1.20'

Expand All @@ -100,7 +100,7 @@ jobs:
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
fetch-depth: 0
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: '1.20'

Expand Down
4 changes: 2 additions & 2 deletions cmd/terramate/cli/cloud_credential_google.go
Expand Up @@ -148,13 +148,13 @@ func startServer(
}
}()

rand.Seed(time.Now().UnixNano())
rng := rand.New(rand.NewSource(time.Now().UnixNano()))

var ln net.Listener
const maxretry = 5
var retry int
for retry = 0; retry < maxretry; retry++ {
addr := "127.0.0.1:" + strconv.Itoa(minPort+rand.Intn(maxPort-minPort))
addr := "127.0.0.1:" + strconv.Itoa(minPort+rng.Intn(maxPort-minPort))
s.Addr = addr

ln, err = net.Listen("tcp", addr)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
@@ -1,6 +1,6 @@
module github.com/terramate-io/terramate

go 1.18
go 1.20

require (
github.com/alecthomas/kong v0.7.1
Expand Down

0 comments on commit 71f30ad

Please sign in to comment.