Skip to content

Commit

Permalink
Use the go version from go.mod by default
Browse files Browse the repository at this point in the history
...but still allow specifying the version explicitly. I'd annoyingly
picked the explicit-go-version path only, but that makes it difficult
to deal with version bumps.
  • Loading branch information
antifuchs committed Aug 22, 2023
1 parent 3ab3fac commit 4f8b6f5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci_baseline_go_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ on:
type: string
default: "."
go_version:
description: "Go toolchain to use"
description: "Go toolchain to use. If unspecified, will use the version given in go.mod in module_base."
type: string
default: "1.20"
subdir:
description: "Directory containing the main.go of the executable being built"
type: string
Expand All @@ -36,6 +35,7 @@ jobs:
- uses: actions/setup-go@v4
with:
go-version: ${{inputs.go_version}}
go-version-file: ${{inputs.module_base}}/go.mod
- run: go build -v ./${{inputs.subdir}}
id: build
working-directory: ${{inputs.module_base}}
4 changes: 2 additions & 2 deletions .github/workflows/ci_baseline_go_lints.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ on:
type: string
default: "."
go_version:
description: "Go toolchain to use"
description: "Go toolchain to use. If unspecified, will use the version given in go.mod in module_base."
type: string
default: "1.20"

# Used for testing this repo:
_internal_continue_on_error:
Expand All @@ -32,6 +31,7 @@ jobs:
- uses: actions/setup-go@v4
with:
go-version: ${{inputs.go_version}}
go-version-file: ${{inputs.module_base}}/go.mod
- name: golangci-lint
id: lint
uses: golangci/golangci-lint-action@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci_baseline_go_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ on:
type: string
default: "."
go_version:
description: "Go toolchain to use"
description: "Go toolchain to use. If unspecified, will use the version given in go.mod in module_base."
type: string
default: "1.20"

# Used for testing this repo:
_internal_continue_on_error:
Expand All @@ -32,6 +31,7 @@ jobs:
- uses: actions/setup-go@v4
with:
go-version: ${{inputs.go_version}}
go-version-file: ${{inputs.module_base}}/go.mod
- run: go test -v ./...
id: test
working-directory: ${{inputs.module_base}}

0 comments on commit 4f8b6f5

Please sign in to comment.