| name: Pre-commit checks |
| |
| on: |
| pull_request: |
| branches: |
| - master |
| |
| jobs: |
| build: |
| runs-on: ubuntu-latest |
| steps: |
| - name: Checkout source code |
| uses: actions/checkout@v3 |
| with: |
| fetch-depth: 2 |
| - name: Check license |
| run: make license-check |
| - name: Set up Go |
| uses: actions/setup-go@v3 |
| with: |
| go-version-file: .go_version |
| - name: Go lint |
| run: make lint |
| - name: Run Version Check |
| run: make pseudo |
| - name: Run ShellCheck |
| run: make check_scripts |
| - name: Unit tests |
| run: make test |
| - name: Code coverage |
| uses: codecov/codecov-action@v3 |
| |
| e2e-tests: |
| needs: build |
| runs-on: ubuntu-latest |
| strategy: |
| fail-fast: false |
| matrix: |
| k8s: [v1.25.0, v1.24.4, v1.23.10, v1.22.13, v1.21.14, v1.20.15] |
| plugin: ['', '--plugin'] |
| steps: |
| - name: Checkout source code |
| uses: actions/checkout@v3 |
| with: |
| fetch-depth: 2 |
| - name: Set up Go |
| uses: actions/setup-go@v3 |
| with: |
| go-version-file: .go_version |
| - run: ./scripts/run-e2e-tests.sh -a "test" -n "yk8s" -v "kindest/node:${KIND_NODE_IMAGE}" --force-kind-install ${KIND_EXTRA_ARGS} |
| env: |
| KIND_NODE_IMAGE: ${{ matrix.k8s }} |
| KIND_EXTRA_ARGS: ${{ matrix.plugin }} |