name: Sandbox Kubernetes Tests on: pull_request: branches: [ main ] permissions: contents: read pull-requests: read concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true env: GO_VERSION: '1.24' jobs: changes: uses: ./.github/workflows/detect-changes.yml with: area: kubernetes controller-e2e-core: name: Controller E2E Core (Kubernetes v${{ matrix.version }}) needs: changes if: needs.changes.outputs.relevant == 'true' strategy: fail-fast: false matrix: version: ["1.21.1", "1.22.4", "1.24.4", "1.26.4", "1.28.6", "1.30.4", "1.32.2", "1.34.2"] runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v6 - name: Set up Go uses: actions/setup-go@v6 with: go-version: ${{ env.GO_VERSION }} - name: Run core e2e tests working-directory: kubernetes run: | make test-e2e-core KIND_K8S_VERSION=v${{ matrix.version }} controller-e2e-pause-resume: name: Controller E2E PauseResume (Kubernetes v${{ matrix.version }}) needs: changes if: needs.changes.outputs.relevant == 'true' strategy: fail-fast: false matrix: version: ["1.21.1", "1.22.4", "1.24.4", "1.26.4", "1.28.6", "1.30.4", "1.32.2", "1.34.2"] runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v6 - name: Set up Go uses: actions/setup-go@v6 with: go-version: ${{ env.GO_VERSION }} - name: Run pause-resume e2e tests working-directory: kubernetes run: | make test-e2e-pause-resume KIND_K8S_VERSION=v${{ matrix.version }} test: needs: changes if: needs.changes.outputs.relevant == 'true' runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v6 - name: Set up Go uses: actions/setup-go@v6 with: go-version: '1.24.0' - name: Check gofmt working-directory: kubernetes run: | files="$(gofmt -l .)" if [ -n "$files" ]; then echo "$files" exit 1 fi - name: Run golint working-directory: kubernetes run: | make lint - name: Build binary working-directory: kubernetes run: | make build make task-executor-build - name: Run tests working-directory: kubernetes run: | make test required: name: Kubernetes CI if: always() needs: [changes, controller-e2e-core, controller-e2e-pause-resume, test] runs-on: ubuntu-latest steps: - name: Verify required jobs env: RELEVANT: ${{ needs.changes.outputs.relevant }} CHANGES_RESULT: ${{ needs.changes.result }} CORE_RESULT: ${{ needs.controller-e2e-core.result }} PAUSE_RESUME_RESULT: ${{ needs.controller-e2e-pause-resume.result }} TEST_RESULT: ${{ needs.test.result }} run: | if [[ "$CHANGES_RESULT" != "success" ]]; then echo "Change detection failed: $CHANGES_RESULT" exit 1 fi if [[ "$RELEVANT" == "true" ]]; then [[ "$CORE_RESULT" == "success" && "$PAUSE_RESUME_RESULT" == "success" && "$TEST_RESULT" == "success" ]] else [[ "$RELEVANT" == "false" && "$CORE_RESULT" == "skipped" && "$PAUSE_RESUME_RESULT" == "skipped" && "$TEST_RESULT" == "skipped" ]] fi