From 3710fdcf0247adbc370dbde672c5fa71c72691bd Mon Sep 17 00:00:00 2001 From: Jamie Tanna Date: Sat, 10 Feb 2024 15:28:28 +0000 Subject: [PATCH 1/2] chore: simplify CI build matrix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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` 🙃 --- .github/workflows/ci.yml | 12 ++++-------- .github/workflows/generate.yml | 12 ++++-------- .github/workflows/lint.yml | 12 ++++-------- .github/workflows/tidy.yml | 12 ++++-------- 4 files changed, 16 insertions(+), 32 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 077863b..4cec680 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,13 +8,9 @@ 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 @@ -22,7 +18,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v3 with: - ${{ matrix.strategy }}: ${{ matrix.version }} + go-version: ${{ matrix.version }} - name: Test run: make test diff --git a/.github/workflows/generate.yml b/.github/workflows/generate.yml index 0d49502..4b1619e 100644 --- a/.github/workflows/generate.yml +++ b/.github/workflows/generate.yml @@ -8,13 +8,9 @@ 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 @@ -22,7 +18,7 @@ jobs: - 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 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 816093d..1756e48 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -8,13 +8,9 @@ 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 @@ -22,7 +18,7 @@ jobs: - 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 diff --git a/.github/workflows/tidy.yml b/.github/workflows/tidy.yml index 6cda48d..eee49f8 100644 --- a/.github/workflows/tidy.yml +++ b/.github/workflows/tidy.yml @@ -8,13 +8,9 @@ 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 @@ -22,7 +18,7 @@ jobs: - 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 From 9bdddbfb57879cd1249b52822a29119704814cdf Mon Sep 17 00:00:00 2001 From: Jamie Tanna Date: Sat, 10 Feb 2024 15:37:51 +0000 Subject: [PATCH 2/2] chore: build against Go 1.22 --- .github/workflows/ci.yml | 1 + .github/workflows/generate.yml | 1 + .github/workflows/lint.yml | 1 + .github/workflows/tidy.yml | 1 + 4 files changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4cec680..61e7400 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,6 +11,7 @@ jobs: version: - "1.20" - "1.21" + - "1.22" steps: - name: Check out source code uses: actions/checkout@v3 diff --git a/.github/workflows/generate.yml b/.github/workflows/generate.yml index 4b1619e..84557d1 100644 --- a/.github/workflows/generate.yml +++ b/.github/workflows/generate.yml @@ -11,6 +11,7 @@ jobs: version: - "1.20" - "1.21" + - "1.22" steps: - name: Check out source code uses: actions/checkout@v3 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 1756e48..0a54d3f 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -11,6 +11,7 @@ jobs: version: - "1.20" - "1.21" + - "1.22" steps: - name: Check out source code uses: actions/checkout@v3 diff --git a/.github/workflows/tidy.yml b/.github/workflows/tidy.yml index eee49f8..51b827b 100644 --- a/.github/workflows/tidy.yml +++ b/.github/workflows/tidy.yml @@ -11,6 +11,7 @@ jobs: version: - "1.20" - "1.21" + - "1.22" steps: - name: Check out source code uses: actions/checkout@v3