name: ci-pipeline on: push: branches: [ master ] pull_request: branches: [ master ] jobs: ci: strategy: fail-fast: false matrix: go-version: ['1.25', '1.26'] runs-on: ubuntu-latest steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6.0.0 - name: Set up Go uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v6.0.0 with: go-version: ${{ matrix.go-version }} - name: Build run: | go mod tidy && git diff --exit-code go build ./cmd/... ./pkg/... - name: Format run: | diff=$(gofmt -s -d .) if [[ -n "${diff}" ]]; then echo "${diff}"; exit 1; fi - name: Test run: | go test -race ./cmd/... ./pkg/... - name: Run integration tests run: | cd test/integration go mod tidy && git diff --exit-code go test ./... # We set the maximum version of the go directive here according to # the oldest Go toolchain (.go-version) in use on our supported # release branches in k/k. - name: Run verify scripts run: | ./hack/verify-go-directive.sh 1.25.0 ci-go-tip: # Informational lane that exercises the vendored encoding/json/v2 shim # against Go tip so upstream changes (e.g. graduating JSONv2 to baseline) # surface here rather than in kubernetes/kubernetes CI. runs-on: ubuntu-latest continue-on-error: true steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6.0.0 - name: Set up Go stable uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v6.0.0 with: go-version: 'stable' - name: Install gotip run: | go install golang.org/dl/gotip@latest gotip download - name: Build with gotip (default GOEXPERIMENT) run: | gotip build ./cmd/... ./pkg/... - name: Test with gotip (default GOEXPERIMENT) run: | gotip test -race ./cmd/... ./pkg/... required: # The name of the ci jobs above change based on the golang version. # Use this as a stable required job that depends on the above jobs. # ref: https://github.com/kubernetes/test-infra/pull/27016 needs: ci runs-on: ubuntu-latest steps: - run: echo "Required jobs success!"