name: ci-pipeline

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:

  ci:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        go: [ '1.18', '1.x' ]
        gostable: [true]
        include:
        - go: '1.x'
          gostable: false
    steps:
    - uses: actions/checkout@v2
      with:
        path: src/k8s.io/kube-openapi/

    - name: Set up Go
      uses: actions/setup-go@v2
      with:
        go-version: "${{ matrix.go }}"
        stable: ${{ matrix.gostable }}"

    - name: Build
      run: |
        cd ${GITHUB_WORKSPACE}/src/k8s.io/kube-openapi/
        go mod tidy && git diff --exit-code
        go build ./cmd/... ./pkg/...
    - name: Test
      run: |
        cd ${GITHUB_WORKSPACE}/src/k8s.io/kube-openapi/
        GOPATH=${GITHUB_WORKSPACE} go test ./cmd/... ./pkg/... ./test/...

name: ci-pipeline

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:

  ci:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        go: [ '1.18', '1.x' ]
        gostable: [true]
        include:
        - go: '1.x'
          gostable: false
    steps:
    - uses: actions/checkout@v2
      with:
        path: src/k8s.io/kube-openapi/

    - name: Set up Go
      uses: actions/setup-go@v2
      with:
        go-version: "${{ matrix.go }}"
        stable: ${{ matrix.gostable }}"

    - name: Build
      run: |
        cd ${GITHUB_WORKSPACE}/src/k8s.io/kube-openapi/
        go mod tidy && git diff --exit-code
        go build ./cmd/... ./pkg/...
    - name: Test
      run: |
        cd ${GITHUB_WORKSPACE}/src/k8s.io/kube-openapi/
        GOPATH=${GITHUB_WORKSPACE} go test ./cmd/... ./pkg/... ./test/...
  required:
    needs: ci
    runs-on: ubuntu-latest
    steps:
    - run: echo "Required jobs success!"

Add required job that depends on matrix jobs
Add required job that depends on matrix jobs
