Skip to content

Commit

Permalink
chore: simplify CI build matrix
Browse files Browse the repository at this point in the history
Although we originally thought this would be a useful way to do this, it
doesn't enforce the `go.mod` constraints that we'd hoped it would, as
Renovate could bump the `go.mod`'s `go` directive, and it means that we
have a more explicit, and less magic, setup.

Additionally, we need to quote the versions as `1.20` gets interpreted
by YAML as `1.2` 🙃
  • Loading branch information
jamietanna committed Feb 10, 2024
1 parent 2a744df commit 3d047b7
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 32 deletions.
12 changes: 4 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,17 @@ jobs:
fail-fast: false
# perform matrix testing to give us an earlier insight into issues with different versions of supported major versions of Go
matrix:
# strategy is used to allow us to pin to a specific Go version, or use the version available in our `go.mod`
strategy: ['go-version']
version: [1.21]
include:
# pick up the Go version from the `go.mod`
- strategy: 'go-version-file'
version: 'go.mod'
version:
- "1.20"
- "1.21"
steps:
- name: Check out source code
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v3
with:
${{ matrix.strategy }}: ${{ matrix.version }}
go-version: ${{ matrix.version }}

- name: Test
run: make test
12 changes: 4 additions & 8 deletions .github/workflows/generate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,17 @@ jobs:
fail-fast: false
# perform matrix testing to give us an earlier insight into issues with different versions of supported major versions of Go
matrix:
# strategy is used to allow us to pin to a specific Go version, or use the version available in our `go.mod`
strategy: ['go-version']
version: [1.21]
include:
# pick up the Go version from the `go.mod`
- strategy: 'go-version-file'
version: 'go.mod'
version:
- "1.20"
- "1.21"
steps:
- name: Check out source code
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v3
with:
${{ matrix.strategy }}: ${{ matrix.version }}
go-version: ${{ matrix.version }}

- name: Run `make generate`
run: make generate
Expand Down
12 changes: 4 additions & 8 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,17 @@ jobs:
fail-fast: false
# perform matrix testing to give us an earlier insight into issues with different versions of supported major versions of Go
matrix:
# strategy is used to allow us to pin to a specific Go version, or use the version available in our `go.mod`
strategy: ['go-version']
version: [1.21]
include:
# pick up the Go version from the `go.mod`
- strategy: 'go-version-file'
version: 'go.mod'
version:
- "1.20"
- "1.21"
steps:
- name: Check out source code
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v3
with:
${{ matrix.strategy }}: ${{ matrix.version }}
go-version: ${{ matrix.version }}

- name: Run `make lint-ci`
run: make lint-ci
12 changes: 4 additions & 8 deletions .github/workflows/tidy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,17 @@ jobs:
fail-fast: false
# perform matrix testing to give us an earlier insight into issues with different versions of supported major versions of Go
matrix:
# strategy is used to allow us to pin to a specific Go version, or use the version available in our `go.mod`
strategy: ['go-version']
version: [1.21]
include:
# pick up the Go version from the `go.mod`
- strategy: 'go-version-file'
version: 'go.mod'
version:
- "1.20"
- "1.21"
steps:
- name: Check out source code
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v3
with:
${{ matrix.strategy }}: ${{ matrix.version }}
go-version: ${{ matrix.version }}

- name: Install `tidied`
run: go install gitlab.com/jamietanna/tidied@latest
Expand Down

0 comments on commit 3d047b7

Please sign in to comment.