Refactor: Move setup-go-kpt composite action from porch to kpt #5221
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Copyright 2021, 2026 The kpt Authors | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, software | |
| # distributed under the License is distributed on an "AS IS" BASIS, | |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| # See the License for the specific language governing permissions and | |
| # limitations under the License. | |
| # Live Apply Tests using go test framework. | |
| # | |
| # Do not use workflow-level paths-ignore for required checks. | |
| # GitHub leaves skipped required workflows Pending forever. | |
| # Instead, we always run the workflow and skip individual jobs conditionally. | |
| name: Live Apply | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - '!dependabot/*' | |
| jobs: | |
| # Detect which path groups changed to conditionally skip expensive jobs. | |
| changes: | |
| name: detect changes | |
| runs-on: ubuntu-latest | |
| outputs: | |
| live: ${{ steps.filter.outputs.live }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: dorny/paths-filter@v4 | |
| id: filter | |
| with: | |
| filters: | | |
| live: | |
| - 'api/**' | |
| - 'commands/live/**' | |
| - 'commands/pkg/**' | |
| - 'e2e/live/**' | |
| - 'pkg/**' | |
| - 'go.mod' | |
| - 'go.sum' | |
| - '.github/workflows/live-e2e.yml' | |
| live-apply: | |
| name: live-apply-k8s${{ matrix.k8s }} | |
| needs: changes | |
| if: needs.changes.outputs.live == 'true' | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - k8s: "1.35" | |
| version: "1.35.5@sha256:ce977ae6d65918d0b58a5f8b5e940429c2ce42fa3a5619ec2bbc60b949c0ac95" | |
| - k8s: "1.36" | |
| version: "1.36.1@sha256:3489c7674813ba5d8b1a9977baea8a6e553784dab7b84759d1014dbd78f7ebd5" | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v6 | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: go.mod | |
| - name: Install Kind | |
| uses: helm/kind-action@v1 | |
| with: | |
| version: v0.32.0 | |
| install_only: true | |
| - name: Run Tests | |
| env: | |
| K8S_VERSION: ${{ matrix.version }} | |
| run: | | |
| K8S_VERSION=$K8S_VERSION make test-live-apply | |
| live-apply-gate: | |
| name: live-apply | |
| needs: [changes, live-apply] | |
| if: always() | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check results | |
| run: | | |
| # If no live changes, this check is not applicable, pass. | |
| if [ "${{ needs.changes.result }}" != "success" ]; then | |
| echo "changes job did not succeed" | |
| exit 1 | |
| fi | |
| if [ "${{ needs.changes.outputs.live }}" = "false" ]; then | |
| echo "No live changes, skipping Live Apply tests" | |
| exit 0 | |
| fi | |
| # If any required job did not succeed, fail this check. | |
| if [ "${{ needs.live-apply.result }}" != "success" ]; then | |
| echo "Live Apply tests failed or did not complete" | |
| exit 1 | |
| fi | |
| echo "Live Apply tests passed" | |