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