...

Text file src/k8s.io/utils/.github/workflows/test.yml

Documentation: k8s.io/utils/.github/workflows

     1name: Test
     2on: [push, pull_request]
     3jobs:
     4  build:
     5    strategy:
     6      matrix:
     7        go-version: [1.20.x, 1.21.x]
     8        platform: [windows-latest]
     9    runs-on: ${{ matrix.platform }}
    10    steps:
    11      - name: Install Go
    12        uses: actions/setup-go@v3
    13        with:
    14          go-version: ${{ matrix.go-version }}
    15      - name: Checkout code
    16        uses: actions/checkout@v2
    17      - name: Build
    18        run: |
    19          go build ./...
    20      - name: Run Windows Unit Tests
    21        run: |
    22          $env:GH_ACTION="TRUE"
    23          go test -v -race ./mount/...
    24  test:
    25    strategy:
    26      matrix:
    27        go-version: [1.20.x, 1.21.x]
    28        platform: [ubuntu-latest, macos-latest]
    29    runs-on: ${{ matrix.platform }}
    30    steps:
    31    - name: Install Go
    32      uses: actions/setup-go@v3
    33      with:
    34        go-version: ${{ matrix.go-version }}
    35    - name: Checkout code
    36      uses: actions/checkout@v2
    37    - name: Test
    38      run: |
    39        make test
    40  verify-go-directive:
    41    strategy:
    42      matrix:
    43        go-version: [1.20.x, 1.21.x]
    44        platform: [ubuntu-latest, macos-latest]
    45    runs-on: ${{ matrix.platform }}
    46    steps:
    47    - name: Install Go
    48      uses: actions/setup-go@v3
    49      with:
    50        go-version: ${{ matrix.go-version }}
    51    - name: Checkout code
    52      uses: actions/checkout@v2
    53    - name: Verify go directive
    54      run: |
    55        make verify-go-directive
    56  lint:
    57    runs-on: ubuntu-latest
    58    steps:
    59      - name: Install Go
    60        uses: actions/setup-go@v3
    61      - name: Checkout code
    62        uses: actions/checkout@v2
    63      - name: Lint
    64        run: |
    65          docker run --rm -v `pwd`:/go/src/k8s.io/klog -w /go/src/k8s.io/klog \
    66            golangci/golangci-lint:v1.51.2 golangci-lint run --disable-all -v \
    67            -E govet -E misspell -E gofmt -E ineffassign -E golint
    68  apidiff:
    69    runs-on: ubuntu-latest
    70    if: github.base_ref
    71    steps:
    72      - name: Install Go
    73        uses: actions/setup-go@v3
    74        with:
    75          go-version: 1.21.x
    76      - name: Add GOBIN to PATH
    77        run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
    78      - name: Install dependencies
    79        run: go install golang.org/x/exp/cmd/apidiff@latest
    80      - name: Checkout old code
    81        uses: actions/checkout@v2
    82        with:
    83          ref: ${{ github.base_ref }}
    84          path: "old"
    85      - name: Checkout new code
    86        uses: actions/checkout@v2
    87        with:
    88          path: "new"
    89      - name: APIDiff
    90        run: ./hack/verify-apidiff.sh -d ../old
    91        working-directory: "new"

View as plain text