Skip to content

Commit ddd96c6

Browse files
committed
ci: latest Go versions in build matrix
Also switch to go1.15.15 for go generate Signed-off-by: Paul Jolly <[email protected]> Change-Id: Id33722474bf8ad1f59681189bb2962e4426e24ab Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/526435 Unity-Result: CUEcueckoo <[email protected]> TryBot-Result: CUEcueckoo <[email protected]>
1 parent 5cf1aa1 commit ddd96c6

File tree

8 files changed

+89
-58
lines changed

8 files changed

+89
-58
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Install Go
2020
uses: actions/setup-go@v2
2121
with:
22-
go-version: "1.17"
22+
go-version: 1.17.2
2323
stable: false
2424
- name: Setup qemu
2525
uses: docker/setup-qemu-action@v1

.github/workflows/test.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,9 @@ jobs:
3737
fail-fast: false
3838
matrix:
3939
go-version:
40-
- 1.14.14
41-
- "1.17"
42-
- 1.15.8
43-
- "1.16"
40+
- 1.15.15
41+
- 1.16.9
42+
- 1.17.2
4443
os:
4544
- ubuntu-18.04
4645
- macos-10.15
@@ -75,13 +74,13 @@ jobs:
7574
- if: ${{ github.ref == 'refs/heads/master' }}
7675
name: Set go build tags
7776
run: go env -w GOFLAGS=-tags=long
78-
- if: matrix.go-version == '1.14.14' && matrix.os != 'windows-2019'
77+
- if: matrix.go-version == '1.15.15' && matrix.os != 'windows-2019'
7978
name: Generate
8079
run: go generate ./...
8180
- name: Test
8281
run: go test ./...
8382
- if: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/ci/')
84-
&& matrix.go-version == '1.17' && matrix.os == 'ubuntu-18.04' }}
83+
&& matrix.go-version == '1.17.2' && matrix.os == 'ubuntu-18.04' }}
8584
name: Test with -race
8685
run: go test -race ./...
8786
- name: gorelease check

cmd/cue/cmd/testdata/script/cmd_github.txt

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ jobs:
9292
- name: Install Go
9393
uses: actions/setup-go@v2
9494
with:
95-
go-version: "1.17"
95+
go-version: 1.17.2
9696
stable: false
9797
- name: Setup qemu
9898
uses: docker/setup-qemu-action@v1
@@ -184,10 +184,9 @@ jobs:
184184
fail-fast: false
185185
matrix:
186186
go-version:
187-
- 1.14.14
188-
- "1.17"
189-
- 1.15.8
190-
- "1.16"
187+
- 1.15.15
188+
- 1.16.9
189+
- 1.17.2
191190
os:
192191
- ubuntu-18.04
193192
- macos-10.15
@@ -222,13 +221,13 @@ jobs:
222221
- if: ${{ github.ref == 'refs/heads/master' }}
223222
name: Set go build tags
224223
run: go env -w GOFLAGS=-tags=long
225-
- if: matrix.go-version == '1.14.14' && matrix.os != 'windows-2019'
224+
- if: matrix.go-version == '1.15.15' && matrix.os != 'windows-2019'
226225
name: Generate
227226
run: go generate ./...
228227
- name: Test
229228
run: go test ./...
230229
- if: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/ci/')
231-
&& matrix.go-version == '1.17' && matrix.os == 'ubuntu-18.04' }}
230+
&& matrix.go-version == '1.17.2' && matrix.os == 'ubuntu-18.04' }}
232231
name: Test with -race
233232
run: go test -race ./...
234233
- name: gorelease check
@@ -1369,19 +1368,19 @@ _#step: ((_#job & {
13691368
steps: _
13701369
}).steps & [_])[0]
13711370

1372-
// We need at least go1.14 for code generation
1373-
_#codeGenGo: "1.14.14"
1371+
// We use the latest go1.15 for code generation
1372+
_#codeGenGo: "1.15.15"
13741373

13751374
// Use a specific latest version for release builds
1376-
_#latestStableGo: "1.17"
1375+
_#latestStableGo: "1.17.2"
13771376
_#linuxMachine: "ubuntu-18.04"
13781377
_#macosMachine: "macos-10.15"
13791378
_#windowsMachine: "windows-2019"
13801379
_#testStrategy: {
13811380
"fail-fast": false
13821381
matrix: {
13831382
// Use a stable version of 1.14.x for go generate
1384-
"go-version": [_#codeGenGo, _#latestStableGo, "1.15.8", "1.16"]
1383+
"go-version": [_#codeGenGo, "1.16.9", _#latestStableGo]
13851384
os: [_#linuxMachine, _#macosMachine, _#windowsMachine]
13861385
}
13871386
}

cue/testdata/eval/github.txtar

Lines changed: 25 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -259,19 +259,19 @@ _#step: ((_#job & {
259259
steps: _
260260
}).steps & [_])[0]
261261

262-
// We need at least go1.14 for code generation
263-
_#codeGenGo: "1.14.14"
262+
// We use the latest go1.15 for code generation
263+
_#codeGenGo: "1.15.15"
264264

265265
// Use a specific latest version for release builds
266-
_#latestStableGo: "1.17"
266+
_#latestStableGo: "1.17.2"
267267
_#linuxMachine: "ubuntu-18.04"
268268
_#macosMachine: "macos-10.15"
269269
_#windowsMachine: "windows-2019"
270270
_#testStrategy: {
271271
"fail-fast": false
272272
matrix: {
273273
// Use a stable version of 1.14.x for go generate
274-
"go-version": [_#codeGenGo, _#latestStableGo, "1.15.8", "1.16"]
274+
"go-version": [_#codeGenGo, "1.16.9", _#latestStableGo]
275275
os: [_#linuxMachine, _#macosMachine, _#windowsMachine]
276276
}
277277
}
@@ -1088,10 +1088,9 @@ import "strings"
10881088
"fail-fast": (bool){ false }
10891089
matrix: (#struct){
10901090
"go-version": (#list){
1091-
0: (string){ "1.14.14" }
1092-
1: (string){ "1.17" }
1093-
2: (string){ "1.15.8" }
1094-
3: (string){ "1.16" }
1091+
0: (string){ "1.15.15" }
1092+
1: (string){ "1.16.9" }
1093+
2: (string){ "1.17.2" }
10951094
}
10961095
os: (#list){
10971096
0: (string){ "ubuntu-18.04" }
@@ -1136,7 +1135,7 @@ import "strings"
11361135
5: (#struct){
11371136
name: (string){ "Generate" }
11381137
run: (string){ "go generate ./..." }
1139-
if: (string){ "matrix.go-version == '1.14.14' && matrix.os != 'windows-2019'" }
1138+
if: (string){ "matrix.go-version == '1.15.15' && matrix.os != 'windows-2019'" }
11401139
}
11411140
6: (#struct){
11421141
name: (string){ "Test" }
@@ -1145,7 +1144,7 @@ import "strings"
11451144
7: (#struct){
11461145
name: (string){ "Test with -race" }
11471146
run: (string){ "go test -race ./..." }
1148-
if: (string){ "${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/ci/') && matrix.go-version == '1.17' && matrix.os == 'ubuntu-18.04' }}" }
1147+
if: (string){ "${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/ci/') && matrix.go-version == '1.17.2' && matrix.os == 'ubuntu-18.04' }}" }
11491148
}
11501149
8: (#struct){
11511150
name: (string){ "gorelease check" }
@@ -1390,7 +1389,7 @@ import "strings"
13901389
name: (string){ "Install Go" }
13911390
uses: (string){ "actions/setup-go@v2" }
13921391
with: (#struct){
1393-
"go-version": (string){ "1.17" }
1392+
"go-version": (string){ "1.17.2" }
13941393
stable: (bool){ false }
13951394
}
13961395
}
@@ -1670,10 +1669,9 @@ import "strings"
16701669
"fail-fast": (bool){ false }
16711670
matrix: (#struct){
16721671
"go-version": (#list){
1673-
0: (string){ "1.14.14" }
1674-
1: (string){ "1.17" }
1675-
2: (string){ "1.15.8" }
1676-
3: (string){ "1.16" }
1672+
0: (string){ "1.15.15" }
1673+
1: (string){ "1.16.9" }
1674+
2: (string){ "1.17.2" }
16771675
}
16781676
os: (#list){
16791677
0: (string){ "ubuntu-18.04" }
@@ -1718,7 +1716,7 @@ import "strings"
17181716
5: (#struct){
17191717
name: (string){ "Generate" }
17201718
run: (string){ "go generate ./..." }
1721-
if: (string){ "matrix.go-version == '1.14.14' && matrix.os != 'windows-2019'" }
1719+
if: (string){ "matrix.go-version == '1.15.15' && matrix.os != 'windows-2019'" }
17221720
}
17231721
6: (#struct){
17241722
name: (string){ "Test" }
@@ -1727,7 +1725,7 @@ import "strings"
17271725
7: (#struct){
17281726
name: (string){ "Test with -race" }
17291727
run: (string){ "go test -race ./..." }
1730-
if: (string){ "${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/ci/') && matrix.go-version == '1.17' && matrix.os == 'ubuntu-18.04' }}" }
1728+
if: (string){ "${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/ci/') && matrix.go-version == '1.17.2' && matrix.os == 'ubuntu-18.04' }}" }
17311729
}
17321730
8: (#struct){
17331731
name: (string){ "gorelease check" }
@@ -1966,7 +1964,7 @@ import "strings"
19661964
name: (string){ "Install Go" }
19671965
uses: (string){ "actions/setup-go@v2" }
19681966
with: (#struct){
1969-
"go-version": (string){ "1.17" }
1967+
"go-version": (string){ "1.17.2" }
19701968
stable: (bool){ false }
19711969
}
19721970
}
@@ -2239,19 +2237,18 @@ import "strings"
22392237
}
22402238
_#step(:ci): (#struct){
22412239
}
2242-
_#codeGenGo(:ci): (string){ "1.14.14" }
2243-
_#latestStableGo(:ci): (string){ "1.17" }
2240+
_#codeGenGo(:ci): (string){ "1.15.15" }
2241+
_#latestStableGo(:ci): (string){ "1.17.2" }
22442242
_#linuxMachine(:ci): (string){ "ubuntu-18.04" }
22452243
_#macosMachine(:ci): (string){ "macos-10.15" }
22462244
_#windowsMachine(:ci): (string){ "windows-2019" }
22472245
_#testStrategy(:ci): (#struct){
22482246
"fail-fast": (bool){ false }
22492247
matrix: (#struct){
22502248
"go-version": (#list){
2251-
0: (string){ "1.14.14" }
2252-
1: (string){ "1.17" }
2253-
2: (string){ "1.15.8" }
2254-
3: (string){ "1.16" }
2249+
0: (string){ "1.15.15" }
2250+
1: (string){ "1.16.9" }
2251+
2: (string){ "1.17.2" }
22552252
}
22562253
os: (#list){
22572254
0: (string){ "ubuntu-18.04" }
@@ -2292,7 +2289,7 @@ import "strings"
22922289
_#goGenerate(:ci): (#struct){
22932290
name: (string){ "Generate" }
22942291
run: (string){ "go generate ./..." }
2295-
if: (string){ "matrix.go-version == '1.14.14' && matrix.os != 'windows-2019'" }
2292+
if: (string){ "matrix.go-version == '1.15.15' && matrix.os != 'windows-2019'" }
22962293
}
22972294
_#goTest(:ci): (#struct){
22982295
name: (string){ "Test" }
@@ -2645,8 +2642,8 @@ import "strings"
26452642
}).steps & [
26462643
_,
26472644
])[0]
2648-
_#codeGenGo: "1.14.14"
2649-
_#latestStableGo: "1.17"
2645+
_#codeGenGo: "1.15.15"
2646+
_#latestStableGo: "1.17.2"
26502647
_#linuxMachine: "ubuntu-18.04"
26512648
_#macosMachine: "macos-10.15"
26522649
_#windowsMachine: "windows-2019"
@@ -2655,9 +2652,8 @@ import "strings"
26552652
matrix: {
26562653
"go-version": [
26572654
〈2;_#codeGenGo〉,
2655+
"1.16.9",
26582656
〈2;_#latestStableGo〉,
2659-
"1.15.8",
2660-
"1.16",
26612657
]
26622658
os: [
26632659
〈2;_#linuxMachine〉,

internal/ci/workflows.cue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ release: _#bashWorkflow & {
240240
},
241241
_#step & {
242242
name: "Set up Docker Buildx"
243-
uses: "docker/setup-buildx-action@v1"
243+
uses: "docker/setup-buildx-action@v1"
244244
},
245245
_#step & {
246246
name: "Docker Login"
@@ -343,11 +343,11 @@ _#bashWorkflow: json.#Workflow & {
343343
_#job: ((json.#Workflow & {}).jobs & {x: _}).x
344344
_#step: ((_#job & {steps: _}).steps & [_])[0]
345345

346-
// We need at least go1.14 for code generation
347-
_#codeGenGo: "1.14.14"
346+
// We use the latest go1.15 for code generation
347+
_#codeGenGo: "1.15.15"
348348

349349
// Use a specific latest version for release builds
350-
_#latestStableGo: "1.17"
350+
_#latestStableGo: "1.17.2"
351351

352352
_#linuxMachine: "ubuntu-18.04"
353353
_#macosMachine: "macos-10.15"
@@ -357,7 +357,7 @@ _#testStrategy: {
357357
"fail-fast": false
358358
matrix: {
359359
// Use a stable version of 1.14.x for go generate
360-
"go-version": [_#codeGenGo, _#latestStableGo, "1.15.8", "1.16"]
360+
"go-version": [_#codeGenGo, "1.16.9", _#latestStableGo]
361361
os: [_#linuxMachine, _#macosMachine, _#windowsMachine]
362362
}
363363
}

pkg/strconv/pkg.go

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/strconv/strconv.go

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
// Use of this source code is governed by a BSD-style
1717
// license that can be found in the LICENSE file.
1818

19-
//go:generate go run cuelang.org/go/internal/cmd/qgo -exclude=Append,Unquote,Itoa,CanBackquote extract strconv
19+
//go:generate go run cuelang.org/go/internal/cmd/qgo -exclude=Append,Unquote,Itoa,CanBackquote,FormatComplex extract strconv
2020

2121
package strconv
2222

@@ -34,6 +34,30 @@ func FormatBool(b bool) string {
3434
return strconv.FormatBool(b)
3535
}
3636

37+
// ParseComplex converts the string s to a complex number
38+
// with the precision specified by bitSize: 64 for complex64, or 128 for complex128.
39+
// When bitSize=64, the result still has type complex128, but it will be
40+
// convertible to complex64 without changing its value.
41+
//
42+
// The number represented by s must be of the form N, Ni, or N±Ni, where N stands
43+
// for a floating-point number as recognized by ParseFloat, and i is the imaginary
44+
// component. If the second N is unsigned, a + sign is required between the two components
45+
// as indicated by the ±. If the second N is NaN, only a + sign is accepted.
46+
// The form may be parenthesized and cannot contain any spaces.
47+
// The resulting complex number consists of the two components converted by ParseFloat.
48+
//
49+
// The errors that ParseComplex returns have concrete type *NumError
50+
// and include err.Num = s.
51+
//
52+
// If s is not syntactically well-formed, ParseComplex returns err.Err = ErrSyntax.
53+
//
54+
// If s is syntactically well-formed but either component is more than 1/2 ULP
55+
// away from the largest floating point number of the given component's size,
56+
// ParseComplex returns err.Err = ErrRange and c = ±Inf for the respective component.
57+
func ParseComplex(s string, bitSize int) (complex128, error) {
58+
return strconv.ParseComplex(s, bitSize)
59+
}
60+
3761
// ParseFloat converts the string s to a floating-point number
3862
// with the precision specified by bitSize: 32 for float32, or 64 for float64.
3963
// When bitSize=32, the result still has type float64, but it will be
@@ -56,8 +80,8 @@ func FormatBool(b bool) string {
5680
// away from the largest floating point number of the given size,
5781
// ParseFloat returns f = ±Inf, err.Err = ErrRange.
5882
//
59-
// ParseFloat recognizes the strings "NaN", "+Inf", and "-Inf" as their
60-
// respective special floating point values. It ignores case when matching.
83+
// ParseFloat recognizes the strings "NaN", and the (possibly signed) strings "Inf" and "Infinity"
84+
// as their respective special floating point values. It ignores case when matching.
6185
func ParseFloat(s string, bitSize int) (float64, error) {
6286
return strconv.ParseFloat(s, bitSize)
6387
}

pkg/strings/strings.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,23 +165,23 @@ func ToLower(s string) string {
165165

166166
// Trim returns a slice of the string s with all leading and
167167
// trailing Unicode code points contained in cutset removed.
168-
func Trim(s string, cutset string) string {
168+
func Trim(s, cutset string) string {
169169
return strings.Trim(s, cutset)
170170
}
171171

172172
// TrimLeft returns a slice of the string s with all leading
173173
// Unicode code points contained in cutset removed.
174174
//
175175
// To remove a prefix, use TrimPrefix instead.
176-
func TrimLeft(s string, cutset string) string {
176+
func TrimLeft(s, cutset string) string {
177177
return strings.TrimLeft(s, cutset)
178178
}
179179

180180
// TrimRight returns a slice of the string s, with all trailing
181181
// Unicode code points contained in cutset removed.
182182
//
183183
// To remove a suffix, use TrimSuffix instead.
184-
func TrimRight(s string, cutset string) string {
184+
func TrimRight(s, cutset string) string {
185185
return strings.TrimRight(s, cutset)
186186
}
187187

0 commit comments

Comments
 (0)