From a05aff7fdb087963ba95a6974160b8e3060c530b Mon Sep 17 00:00:00 2001 From: Reuven Harrison Date: Wed, 24 Jun 2026 23:40:29 +0300 Subject: [PATCH 1/2] ci: replace the inherited GOPATH matrix with a module-mode matrix The Test job was inherited verbatim from upstream go-yaml/yaml.v3: Go 1.5..tip in GOPATH mode. This fork's go.mod requires go 1.22.5 and the code uses range-over-int / any, so those versions can't build it -- the matrix was failing/meaningless. Replace it with a module-mode matrix on the supported range (1.22.x floor, 1.23.x, latest stable), drop the GOPATH layout and the tip-build hack, and bump actions/checkout + setup-go. The Verify modules job (added in #11) is unchanged. Co-Authored-By: Claude Opus 4.8 --- .github/workflows/go.yaml | 69 ++++++++------------------------------- 1 file changed, 14 insertions(+), 55 deletions(-) diff --git a/.github/workflows/go.yaml b/.github/workflows/go.yaml index 19f7966a..c4cd67c0 100644 --- a/.github/workflows/go.yaml +++ b/.github/workflows/go.yaml @@ -4,68 +4,27 @@ on: [push, pull_request] jobs: test: name: Test - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest strategy: fail-fast: false matrix: - go: - - "1.5" - - "1.6" - - "1.7" - - "1.8" - - "1.9" - - "1.10" - - "1.11" - - "1.12" - - "1.13" - - "1.14" - - "1.15" - - "1.16.0-beta1" - - "tip" - env: - GOPATH: ${{ github.workspace }}/go + # The module requires go 1.22.5 and the code uses modern features + # (range-over-int, any), so test the floor through the latest stable. + # The old upstream matrix (Go 1.5..tip in GOPATH mode) couldn't build + # this fork at all. + go: ["1.22.x", "1.23.x", "stable"] steps: - - name: Check out code into the Go module directory - uses: actions/checkout@v2 - with: - path: ${{ github.workspace }}/go/src/gopkg.in/yaml.v3 - - name: Set up Go ${{ matrix.go }} - if: matrix.go != 'tip' - uses: actions/setup-go@v2 + - uses: actions/checkout@v7 + - uses: actions/setup-go@v6 with: go-version: ${{ matrix.go }} - stable: false - - name: Set up Go ${{ matrix.go }} - if: matrix.go == 'tip' - run: | - export GOROOT_BOOTSTRAP=`go env GOROOT` - export GOROOT=$HOME/gotip - mkdir $HOME/gotip - cd $HOME/gotip - - curl -s 'https://go.googlesource.com/go/+/refs/heads/master?format=JSON' | awk '/"commit"/{print substr($2,2,40);exit}' >HEAD - awk '{printf("gotip-%s",substr($0,0,7))}' VERSION - - curl -s -o go.tar.gz https://go.googlesource.com/go/+archive/`cat HEAD`.tar.gz - tar xfz go.tar.gz - - cd src - bash make.bash - - echo "GOROOT=$GOROOT" >> $GITHUB_ENV - echo "$GOROOT/bin" >> $GITHUB_PATH - - run: go version - - run: go get -t ./... - working-directory: ${{ github.workspace }}/go/src/gopkg.in/yaml.v3 - - run: go test . - working-directory: ${{ github.workspace }}/go/src/gopkg.in/yaml.v3 + - run: go test -race ./... - # The matrix above runs in GOPATH mode across pre-module Go versions, so it - # can't check the module lockfile. This job verifies, on modern Go, that the - # committed go.sum is complete and the cached modules are untampered -- so a - # go.mod pinned to a release tag can't ship with only a pseudo-version (or a - # missing entry) in go.sum, which fails a clean -mod=readonly build but is - # invisible to a CI that runs `go mod download`/`go get` before testing. + # Verify the module lockfile: the committed go.sum must be complete (git diff + # after download) and the cached modules must match their checksums (go mod + # verify) -- so a go.mod pinned to a release tag can't ship with only a + # pseudo-version (or a missing entry) in go.sum, which fails a clean + # -mod=readonly build but is invisible to a CI that downloads before testing. modules: name: Verify modules runs-on: ubuntu-latest From 119bc70ec2d0982228bc376f8311c8e05f339b5d Mon Sep 17 00:00:00 2001 From: Reuven Harrison Date: Wed, 24 Jun 2026 23:43:55 +0300 Subject: [PATCH 2/2] ci: align Go support with oasdiff/yaml (go 1.25, test on stable) oasdiff/yaml declares go 1.25 and tests on the latest stable. Match it here: bump the go directive 1.22.5 -> 1.25 and replace the inherited GOPATH matrix (Go 1.5..tip, which can't build this fork) with a single module-mode job on stable. All consumers are >= 1.25 (kin-openapi 1.25; oasdiff/oasdiff-service 1.26), so the floor bump forces no one up. Co-Authored-By: Claude Opus 4.8 --- .github/workflows/go.yaml | 10 +--------- go.mod | 2 +- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/.github/workflows/go.yaml b/.github/workflows/go.yaml index c4cd67c0..96ae1f17 100644 --- a/.github/workflows/go.yaml +++ b/.github/workflows/go.yaml @@ -5,19 +5,11 @@ jobs: test: name: Test runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - # The module requires go 1.22.5 and the code uses modern features - # (range-over-int, any), so test the floor through the latest stable. - # The old upstream matrix (Go 1.5..tip in GOPATH mode) couldn't build - # this fork at all. - go: ["1.22.x", "1.23.x", "stable"] steps: - uses: actions/checkout@v7 - uses: actions/setup-go@v6 with: - go-version: ${{ matrix.go }} + go-version: stable - run: go test -race ./... # Verify the module lockfile: the committed go.sum must be complete (git diff diff --git a/go.mod b/go.mod index 592873a4..51d674b6 100644 --- a/go.mod +++ b/go.mod @@ -1,5 +1,5 @@ module github.com/oasdiff/yaml3 -go 1.22.5 +go 1.25 require gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405