Skip to content

Commit aead1bf

Browse files
committed
ci: bump to Go 1.20 & improve linting
* Use Go 1.20 & 1.19 in CI (1.18 is now EOL) * `go.mod` now targets 1.19 - in the future, this should be safe to raise to the higher version as we use the new `-compat` flag properly * Update to latest golangci-lint * Move linting to happen as part of test job to ensure that it runs across the matrix of Go & OS versions, as some lint issues can be Go version or OS/platform specific * Upgrade `distribution/v3` to latest Signed-off-by: Milas Bowman <[email protected]>
1 parent 99db19a commit aead1bf

File tree

5 files changed

+15
-13
lines changed

5 files changed

+15
-13
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ jobs:
1212
steps:
1313
- name: Checkout
1414
uses: actions/checkout@v3
15-
- name: Lint code
16-
uses: golangci/golangci-lint-action@v2
1715
- name: Check license
1816
run: DOCKER_BUILDKIT=1 make check-license
1917
- name: Check schema
@@ -22,10 +20,10 @@ jobs:
2220
test:
2321
strategy:
2422
matrix:
25-
go-version: ['1.18', '1.19']
23+
go-version: ['1.20', '1.19']
2624
platform: [ubuntu-latest, macos-latest, windows-latest]
2725
runs-on: ${{ matrix.platform }}
28-
timeout-minutes: 5
26+
timeout-minutes: 10
2927
steps:
3028
- name: Checkout code
3129
uses: actions/checkout@v3
@@ -35,5 +33,8 @@ jobs:
3533
go-version: ${{ matrix.go-version }}
3634
check-latest: true
3735
cache: true
36+
- uses: golangci/golangci-lint-action@v3
37+
with:
38+
version: v1.51.1
3839
- name: Test
3940
run: go test ./...

ci/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
FROM golang:1.18
15+
FROM golang:1.20
1616

1717
WORKDIR /go/src
1818

19-
ARG GOLANGCILINT_VERSION=v1.46.2
19+
ARG GOLANGCILINT_VERSION=v1.51.1
2020
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin ${GOLANGCILINT_VERSION}
2121
RUN go install github.com/kunalkushwaha/ltag@latest && rm -rf /go/src/github.com/kunalkushwaha
2222

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
module github.com/compose-spec/compose-go
22

3-
go 1.18
3+
go 1.19
44

55
require (
6-
github.com/distribution/distribution/v3 v3.0.0-20221103125252-ebfa2a0ac0a9
6+
github.com/distribution/distribution/v3 v3.0.0-20230214150026-36d8c594d7aa
77
github.com/docker/go-connections v0.4.0
88
github.com/docker/go-units v0.5.0
99
github.com/google/go-cmp v0.5.9
@@ -25,6 +25,6 @@ require (
2525
github.com/pmezard/go-difflib v1.0.0 // indirect
2626
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect
2727
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
28-
golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10 // indirect
28+
golang.org/x/sys v0.3.0 // indirect
2929
gopkg.in/yaml.v3 v3.0.1 // indirect
3030
)

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
22
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
33
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
4-
github.com/distribution/distribution/v3 v3.0.0-20221103125252-ebfa2a0ac0a9 h1:doprs/RuXCuN864IfxC3h2qocrt158wGv3A5mcqSZQw=
5-
github.com/distribution/distribution/v3 v3.0.0-20221103125252-ebfa2a0ac0a9/go.mod h1:6rIc5NMSjXjjnwzWWy3HAm9gDBu+X7aCzL8VrHIKgxM=
4+
github.com/distribution/distribution/v3 v3.0.0-20230214150026-36d8c594d7aa h1:L9Ay/slwQ4ERSPaurC+TVkZrM0K98GNrEEo1En3e8as=
5+
github.com/distribution/distribution/v3 v3.0.0-20230214150026-36d8c594d7aa/go.mod h1:WHNsWjnIn2V1LYOrME7e8KxSeKunYHsxEm4am0BUtcI=
66
github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ=
77
github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec=
88
github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4=
@@ -58,8 +58,8 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w
5858
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
5959
golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
6060
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
61-
golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10 h1:WIoqL4EROvwiPdUtaip4VcDdpZ4kha7wBWZrbVKCIZg=
62-
golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
61+
golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ=
62+
golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
6363
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
6464
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
6565
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=

types/types_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,7 @@ func TestMarshalServiceEntrypoint(t *testing.T) {
313313
}
314314

315315
for _, tc := range tcs {
316+
tc := tc
316317
t.Run(tc.name, func(t *testing.T) {
317318
t.Parallel()
318319

0 commit comments

Comments
 (0)