k8s.io/kube-openapi@v0.0.0-20240826222958-65a50c78dec5/.github/workflows/ci.yml (about)

     1  name: ci-pipeline
     2  on:
     3    push:
     4      branches: [ master ]
     5    pull_request:
     6      branches: [ master ]
     7  jobs:
     8    ci:
     9      strategy:
    10        matrix:
    11          go-version: [ '1.20', '1.21', '1.22', '1.23' ]
    12      runs-on: ubuntu-latest
    13      steps:
    14      - uses: actions/checkout@v4
    15      - name: Set up Go
    16        uses: actions/setup-go@v5
    17        with:
    18          go-version: ${{ matrix.go-version }}
    19      - name: Build
    20        run: |
    21          go mod tidy && git diff --exit-code
    22          go build ./cmd/... ./pkg/...
    23      - name: Format
    24        run: |
    25          diff=$(gofmt -s -d .)
    26          if [[ -n "${diff}" ]]; then echo "${diff}"; exit 1; fi
    27      - name: Test
    28        run: |
    29          go test -race ./cmd/... ./pkg/...
    30      - name: Run integration tests
    31        run: |
    32          cd test/integration
    33          go mod tidy && git diff --exit-code
    34          go test ./...
    35      # We set the maximum version of the go directive as 1.20 here
    36      # because the oldest go directive that exists on our supported
    37      # release branches in k/k is 1.20.
    38      - name: Run verify scripts
    39        run: |
    40          ./hack/verify-go-directive.sh 1.20
    41    required:
    42      # The name of the ci jobs above change based on the golang version.
    43      # Use this as a stable required job that depends on the above jobs.
    44      # ref: https://github.com/kubernetes/test-infra/pull/27016
    45      needs: ci
    46      runs-on: ubuntu-latest
    47      steps:
    48      - run: echo "Required jobs success!"