File: ci.yml

package info (click to toggle)
golang-k8s-kube-openapi 0.0~git20241212.2c72e55-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 23,396 kB
  • sloc: sh: 50; makefile: 5
file content (48 lines) | stat: -rw-r--r-- 1,374 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: ci-pipeline
on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]
jobs:
  ci:
    strategy:
      matrix:
        go-version: [ '1.21', '1.22', '1.23' ]
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4
    - name: Set up Go
      uses: actions/setup-go@v5
      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 directive that exists on our supported release branches
    # in k/k.
    - name: Run verify scripts
      run: |
        ./hack/verify-go-directive.sh 1.21
  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!"