From 2a774717e3f33b529b914c5b0bf7e03cb1d73a49 Mon Sep 17 00:00:00 2001 From: Aravindhan Ayyanathan Date: Thu, 18 Jun 2026 13:43:34 +0100 Subject: [PATCH] Simplify CI workflows: remove legacy GOPATH checkout pattern Signed-off-by: Aravindhan Ayyanathan --- .github/workflows/e2eEnvironment.yml | 7 +------ .github/workflows/go.yml | 31 +++++++--------------------- .github/workflows/live-e2e.yml | 8 +------ .github/workflows/release-api.yml | 7 ++----- .github/workflows/release.yml | 10 ++------- .github/workflows/verifyContent.yml | 9 +------- 6 files changed, 14 insertions(+), 58 deletions(-) diff --git a/.github/workflows/e2eEnvironment.yml b/.github/workflows/e2eEnvironment.yml index 731b14b502..9b2e459efd 100644 --- a/.github/workflows/e2eEnvironment.yml +++ b/.github/workflows/e2eEnvironment.yml @@ -37,21 +37,16 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v6 - with: - path: go/src/github.com/kptdev/kpt - name: Set up Go uses: actions/setup-go@v6 with: - go-version-file: go/src/github.com/kptdev/kpt/go.mod - cache: true - cache-dependency-path: go/src/github.com/kptdev/kpt/go.sum + go-version-file: go.mod - name: Install Kind uses: helm/kind-action@v1 with: version: v0.32.0 install_only: true - name: Run Tests - working-directory: go/src/github.com/kptdev/kpt env: K8S_VERSION: ${{ matrix.version }} run: | diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index fa0569bc28..9190982c92 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -31,9 +31,6 @@ on: branches: - '!dependabot/*' -env: - GOPATH: ${{ github.workspace }}/go - jobs: build-test-linux: name: Build-test-kpt-CLI @@ -49,18 +46,13 @@ jobs: run: | which podman podman version - - name: Check out code into the Go module directory + - name: Check out code uses: actions/checkout@v6 - with: - path: ${{ env.GOPATH }}/src/github.com/kptdev/kpt - name: Set up Go uses: actions/setup-go@v6 with: - go-version-file: go/src/github.com/kptdev/kpt/go.mod - cache: true - cache-dependency-path: go/src/github.com/kptdev/kpt/go.sum + go-version-file: go.mod - name: Build, Test, Lint - working-directory: ${{ env.GOPATH }}/src/github.com/kptdev/kpt run: | git config --global user.email you@example.com git config --global user.name Your Name @@ -72,18 +64,13 @@ jobs: build-macos: runs-on: macos-latest steps: - - name: Check out code into the Go module directory + - name: Check out code uses: actions/checkout@v6 - with: - path: ${{ env.GOPATH }}/src/github.com/kptdev/kpt - name: Set up Go uses: actions/setup-go@v6 with: - go-version-file: go/src/github.com/kptdev/kpt/go.mod - cache: true - cache-dependency-path: go/src/github.com/kptdev/kpt/go.sum + go-version-file: go.mod - name: Build - working-directory: ${{ env.GOPATH }}/src/github.com/kptdev/kpt run: | make build @@ -91,16 +78,12 @@ jobs: # build-windows: # runs-on: windows-2019 # steps: +# - name: Check out code +# uses: actions/checkout@v6 # - name: Set up Go # uses: actions/setup-go@v6 # with: -# go-version: '>=1.24' -# id: go -# - name: Check out code into the Go module directory -# uses: actions/checkout@v5 -# with: -# path: ${{ env.GOPATH }}/src/github.com/kptdev/kpt +# go-version-file: go.mod # - name: Build -# working-directory: ${{ env.GOPATH }}/src/github.com/kptdev/kpt # run: | # make build diff --git a/.github/workflows/live-e2e.yml b/.github/workflows/live-e2e.yml index 6674a03890..d8e7255fc0 100644 --- a/.github/workflows/live-e2e.yml +++ b/.github/workflows/live-e2e.yml @@ -36,22 +36,16 @@ jobs: steps: - name: Check out code uses: actions/checkout@v6 - with: - path: go/src/github.com/kptdev/kpt - name: Set up Go uses: actions/setup-go@v6 with: - go-version-file: go/src/github.com/kptdev/kpt/go.mod - cache: true - cache-dependency-path: go/src/github.com/kptdev/kpt/go.sum + go-version-file: go.mod - name: Install Kind uses: helm/kind-action@v1 with: version: v0.32.0 install_only: true - - name: Run Tests - working-directory: go/src/github.com/kptdev/kpt env: K8S_VERSION: ${{ matrix.version }} run: | diff --git a/.github/workflows/release-api.yml b/.github/workflows/release-api.yml index 6e017da4c1..7f3e790bb3 100644 --- a/.github/workflows/release-api.yml +++ b/.github/workflows/release-api.yml @@ -27,15 +27,12 @@ jobs: uses: actions/checkout@v6 with: fetch-depth: 0 - path: go/src/github.com/kptdev/kpt - name: Set up Go uses: actions/setup-go@v6 with: - go-version-file: go/src/github.com/kptdev/kpt/api/go.mod - cache: true - cache-dependency-path: go/src/github.com/kptdev/kpt/api/go.sum + go-version-file: api/go.mod + cache-dependency-path: api/go.sum - name: Build, test, lint (api module) - working-directory: ${{ env.GOPATH }}/src/github.com/kptdev/kpt run: | git config --global user.email you@example.com git config --global user.name Your Name diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9beaac37de..fb231070c3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,15 +31,11 @@ jobs: uses: actions/checkout@v6 with: fetch-depth: 0 - path: go/src/github.com/kptdev/kpt - name: Set up Go uses: actions/setup-go@v6 with: - go-version-file: go/src/github.com/kptdev/kpt/go.mod - cache: true - cache-dependency-path: go/src/github.com/kptdev/kpt/go.sum + go-version-file: go.mod - name: Build, Test, Lint - working-directory: go/src/github.com/kptdev/kpt run: | git config --global user.email you@example.com git config --global user.name Your Name @@ -61,19 +57,17 @@ jobs: with: distribution: goreleaser version: "~> v2" - workdir: go/src/github.com/kptdev/kpt args: release --skip=validate -f release/tag/goreleaser.yaml env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Generate SLSA subjects for provenance id: hash - working-directory: go/src/github.com/kptdev/kpt run: | set -euo pipefail checksum_file=$(cat dist/artifacts.json | jq -r '.[] | select (.type=="Checksum") | .path') - echo "::set-output name=hashes::$(cat $checksum_file | base64 -w0)" + echo "hashes=$(cat $checksum_file | base64 -w0)" >> "$GITHUB_OUTPUT" provenance: needs: [build] diff --git a/.github/workflows/verifyContent.yml b/.github/workflows/verifyContent.yml index 642fed5712..01ab94be46 100644 --- a/.github/workflows/verifyContent.yml +++ b/.github/workflows/verifyContent.yml @@ -32,23 +32,16 @@ jobs: steps: - name: Checkout uses: actions/checkout@v6 - with: - path: go/src/github.com/kptdev/kpt - name: Set up Go uses: actions/setup-go@v6 with: - go-version-file: go/src/github.com/kptdev/kpt/go.mod - cache: true - cache-dependency-path: go/src/github.com/kptdev/kpt/go.sum + go-version-file: go.mod - name: Build - working-directory: go/src/github.com/kptdev/kpt run: | make build - name: Get dependencies - working-directory: go/src/github.com/kptdev/kpt run: | make install-mdrip make install-kind - name: Verify Examples - working-directory: go/src/github.com/kptdev/kpt run: make site-verify-examples