Skip to content

Commit

Permalink
feat: update go build matrix
Browse files Browse the repository at this point in the history
Add Go 1.17 to the build matrix and ensure that the latest version of Go
is used to build release artefacts.

Closes #1223

Signed-off-by: Peter Hrvola <peter.hrvola@gmail.com>
Change-Id: Ica7e8f54623639a86ec0194b70347420c82e4ed8
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/526425
Reviewed-by: Paul Jolly <paul@myitcv.io>
  • Loading branch information
hrvolapeter authored and myitcv committed Oct 29, 2021
1 parent 35c2f3c commit 5cf1aa1
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.15.8
go-version: "1.17"
stable: false
- name: Setup qemu
uses: docker/setup-qemu-action@v1
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:
matrix:
go-version:
- 1.14.14
- "1.17"
- 1.15.8
- "1.16"
os:
Expand Down Expand Up @@ -80,7 +81,7 @@ jobs:
- name: Test
run: go test ./...
- if: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/ci/')
&& matrix.go-version == '1.15.8' && matrix.os == 'ubuntu-18.04' }}
&& matrix.go-version == '1.17' && matrix.os == 'ubuntu-18.04' }}
name: Test with -race
run: go test -race ./...
- name: gorelease check
Expand Down
9 changes: 5 additions & 4 deletions cmd/cue/cmd/testdata/script/cmd_github.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.15.8
go-version: "1.17"
stable: false
- name: Setup qemu
uses: docker/setup-qemu-action@v1
Expand Down Expand Up @@ -185,6 +185,7 @@ jobs:
matrix:
go-version:
- 1.14.14
- "1.17"
- 1.15.8
- "1.16"
os:
Expand Down Expand Up @@ -227,7 +228,7 @@ jobs:
- name: Test
run: go test ./...
- if: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/ci/')
&& matrix.go-version == '1.15.8' && matrix.os == 'ubuntu-18.04' }}
&& matrix.go-version == '1.17' && matrix.os == 'ubuntu-18.04' }}
name: Test with -race
run: go test -race ./...
- name: gorelease check
Expand Down Expand Up @@ -1372,15 +1373,15 @@ _#step: ((_#job & {
_#codeGenGo: "1.14.14"

// Use a specific latest version for release builds
_#latestStableGo: "1.15.8"
_#latestStableGo: "1.17"
_#linuxMachine: "ubuntu-18.04"
_#macosMachine: "macos-10.15"
_#windowsMachine: "windows-2019"
_#testStrategy: {
"fail-fast": false
matrix: {
// Use a stable version of 1.14.x for go generate
"go-version": [_#codeGenGo, _#latestStableGo, "1.16"]
"go-version": [_#codeGenGo, _#latestStableGo, "1.15.8", "1.16"]
os: [_#linuxMachine, _#macosMachine, _#windowsMachine]
}
}
Expand Down
32 changes: 18 additions & 14 deletions cue/testdata/eval/github.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -263,15 +263,15 @@ _#step: ((_#job & {
_#codeGenGo: "1.14.14"

// Use a specific latest version for release builds
_#latestStableGo: "1.15.8"
_#latestStableGo: "1.17"
_#linuxMachine: "ubuntu-18.04"
_#macosMachine: "macos-10.15"
_#windowsMachine: "windows-2019"
_#testStrategy: {
"fail-fast": false
matrix: {
// Use a stable version of 1.14.x for go generate
"go-version": [_#codeGenGo, _#latestStableGo, "1.16"]
"go-version": [_#codeGenGo, _#latestStableGo, "1.15.8", "1.16"]
os: [_#linuxMachine, _#macosMachine, _#windowsMachine]
}
}
Expand Down Expand Up @@ -1089,8 +1089,9 @@ import "strings"
matrix: (#struct){
"go-version": (#list){
0: (string){ "1.14.14" }
1: (string){ "1.15.8" }
2: (string){ "1.16" }
1: (string){ "1.17" }
2: (string){ "1.15.8" }
3: (string){ "1.16" }
}
os: (#list){
0: (string){ "ubuntu-18.04" }
Expand Down Expand Up @@ -1144,7 +1145,7 @@ import "strings"
7: (#struct){
name: (string){ "Test with -race" }
run: (string){ "go test -race ./..." }
if: (string){ "${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/ci/') && matrix.go-version == '1.15.8' && matrix.os == 'ubuntu-18.04' }}" }
if: (string){ "${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/ci/') && matrix.go-version == '1.17' && matrix.os == 'ubuntu-18.04' }}" }
}
8: (#struct){
name: (string){ "gorelease check" }
Expand Down Expand Up @@ -1389,7 +1390,7 @@ import "strings"
name: (string){ "Install Go" }
uses: (string){ "actions/setup-go@v2" }
with: (#struct){
"go-version": (string){ "1.15.8" }
"go-version": (string){ "1.17" }
stable: (bool){ false }
}
}
Expand Down Expand Up @@ -1670,8 +1671,9 @@ import "strings"
matrix: (#struct){
"go-version": (#list){
0: (string){ "1.14.14" }
1: (string){ "1.15.8" }
2: (string){ "1.16" }
1: (string){ "1.17" }
2: (string){ "1.15.8" }
3: (string){ "1.16" }
}
os: (#list){
0: (string){ "ubuntu-18.04" }
Expand Down Expand Up @@ -1725,7 +1727,7 @@ import "strings"
7: (#struct){
name: (string){ "Test with -race" }
run: (string){ "go test -race ./..." }
if: (string){ "${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/ci/') && matrix.go-version == '1.15.8' && matrix.os == 'ubuntu-18.04' }}" }
if: (string){ "${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/ci/') && matrix.go-version == '1.17' && matrix.os == 'ubuntu-18.04' }}" }
}
8: (#struct){
name: (string){ "gorelease check" }
Expand Down Expand Up @@ -1964,7 +1966,7 @@ import "strings"
name: (string){ "Install Go" }
uses: (string){ "actions/setup-go@v2" }
with: (#struct){
"go-version": (string){ "1.15.8" }
"go-version": (string){ "1.17" }
stable: (bool){ false }
}
}
Expand Down Expand Up @@ -2238,7 +2240,7 @@ import "strings"
_#step(:ci): (#struct){
}
_#codeGenGo(:ci): (string){ "1.14.14" }
_#latestStableGo(:ci): (string){ "1.15.8" }
_#latestStableGo(:ci): (string){ "1.17" }
_#linuxMachine(:ci): (string){ "ubuntu-18.04" }
_#macosMachine(:ci): (string){ "macos-10.15" }
_#windowsMachine(:ci): (string){ "windows-2019" }
Expand All @@ -2247,8 +2249,9 @@ import "strings"
matrix: (#struct){
"go-version": (#list){
0: (string){ "1.14.14" }
1: (string){ "1.15.8" }
2: (string){ "1.16" }
1: (string){ "1.17" }
2: (string){ "1.15.8" }
3: (string){ "1.16" }
}
os: (#list){
0: (string){ "ubuntu-18.04" }
Expand Down Expand Up @@ -2643,7 +2646,7 @@ import "strings"
_,
])[0]
_#codeGenGo: "1.14.14"
_#latestStableGo: "1.15.8"
_#latestStableGo: "1.17"
_#linuxMachine: "ubuntu-18.04"
_#macosMachine: "macos-10.15"
_#windowsMachine: "windows-2019"
Expand All @@ -2653,6 +2656,7 @@ import "strings"
"go-version": [
〈2;_#codeGenGo〉,
〈2;_#latestStableGo〉,
"1.15.8",
"1.16",
]
os: [
Expand Down
4 changes: 2 additions & 2 deletions internal/ci/workflows.cue
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ _#step: ((_#job & {steps: _}).steps & [_])[0]
_#codeGenGo: "1.14.14"

// Use a specific latest version for release builds
_#latestStableGo: "1.15.8"
_#latestStableGo: "1.17"

_#linuxMachine: "ubuntu-18.04"
_#macosMachine: "macos-10.15"
Expand All @@ -357,7 +357,7 @@ _#testStrategy: {
"fail-fast": false
matrix: {
// Use a stable version of 1.14.x for go generate
"go-version": [_#codeGenGo, _#latestStableGo, "1.16"]
"go-version": [_#codeGenGo, _#latestStableGo, "1.15.8", "1.16"]
os: [_#linuxMachine, _#macosMachine, _#windowsMachine]
}
}
Expand Down

0 comments on commit 5cf1aa1

Please sign in to comment.