From cbb74bcbc818ab83bd7c91ab1ce1fea5e8490157 Mon Sep 17 00:00:00 2001 From: Adam Hughes <9903835+tri-adam@users.noreply.github.com> Date: Wed, 31 Jul 2024 19:04:47 +0000 Subject: [PATCH 1/2] ci: adopt Go 1.23 --- .github/workflows/build.yaml | 2 +- .github/workflows/check.yaml | 9 ++++----- .github/workflows/release.yaml | 2 +- .github/workflows/style.yaml | 2 +- .github/workflows/test.yaml | 4 ++-- go.mod | 2 +- test/images/gen_images.go | 8 ++++---- 7 files changed, 14 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 6f27233..753e7f1 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -11,7 +11,7 @@ jobs: strategy: matrix: - go-version: ['~1.21.0', '~1.22.0', '~1.23.0-rc.1'] + go-version: ['~1.22.0', '~1.23.0'] steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 408e773..2ad7a40 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -15,9 +15,8 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: '~1.22.0' - - run: go mod tidy - - run: git diff --exit-code -- + go-version: '~1.23.0' + - run: go mod tidy -diff check-test-corpus: name: Check Test Corpus @@ -27,7 +26,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: '~1.22.0' + go-version: '~1.23.0' - run: sudo apt-get install -qy squashfs-tools-ng - run: go run ./test/images/gen_images.go ./test/images - run: git diff --exit-code -- @@ -40,7 +39,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: '~1.22.0' + go-version: '~1.23.0' - uses: goreleaser/goreleaser-action@v6 with: args: check diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index d29a2ea..ec5e698 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -20,7 +20,7 @@ jobs: fetch-depth: 0 - uses: actions/setup-go@v5 with: - go-version: '~1.22.0' + go-version: '~1.23.0' - uses: goreleaser/goreleaser-action@v6 with: args: release diff --git a/.github/workflows/style.yaml b/.github/workflows/style.yaml index 38571f4..bc3bd3a 100644 --- a/.github/workflows/style.yaml +++ b/.github/workflows/style.yaml @@ -22,7 +22,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: '~1.22.0' + go-version: '~1.23.0' - uses: golangci/golangci-lint-action@v6 with: version: v1.59 diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 4adca3d..2297788 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -13,7 +13,7 @@ jobs: strategy: matrix: - go-version: ['~1.21.0', '~1.22.0', '~1.23.0-rc.1'] + go-version: ['~1.22.0', '~1.23.0'] steps: - uses: actions/checkout@v4 @@ -31,7 +31,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: '~1.22.0' + go-version: '~1.23.0' - uses: goreleaser/goreleaser-action@v6 with: args: release --snapshot --skip=publish diff --git a/go.mod b/go.mod index 346ecf2..a4b80fa 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/sylabs/oci-tools -go 1.21.0 +go 1.22.0 require ( github.com/google/go-containerregistry v0.20.2 diff --git a/test/images/gen_images.go b/test/images/gen_images.go index ac29fc3..e540c7a 100644 --- a/test/images/gen_images.go +++ b/test/images/gen_images.go @@ -429,10 +429,10 @@ func generateTARImages(path string) error { } func generateManyLayerImage(path string) error { - var ls []v1.Layer - // Generate 50 unique layers. - for i := 0; i < 50; i++ { + ls := make([]v1.Layer, 50) + + for i := range len(ls) { layer := []tarEntry{ {Typeflag: tar.TypeReg, Name: strconv.Itoa(i)}, } @@ -450,7 +450,7 @@ func generateManyLayerImage(path string) error { return err } - ls = append(ls, l) + ls[i] = l } img, err := mutate.AppendLayers(empty.Image, ls...) From f95fb47a171a0d331164d49924ee425e31f841b0 Mon Sep 17 00:00:00 2001 From: Adam Hughes <9903835+tri-adam@users.noreply.github.com> Date: Mon, 19 Aug 2024 16:25:42 +0000 Subject: [PATCH 2/2] chore: bump golangci-lint to v1.60 --- .github/workflows/style.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/style.yaml b/.github/workflows/style.yaml index bc3bd3a..3fc1720 100644 --- a/.github/workflows/style.yaml +++ b/.github/workflows/style.yaml @@ -25,4 +25,4 @@ jobs: go-version: '~1.23.0' - uses: golangci/golangci-lint-action@v6 with: - version: v1.59 + version: v1.60