Error when explicit destination of pkg get already exists #9356
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 2019-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. | |
| # Go CI workflow for build, test, and lint. | |
| # | |
| # 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. | |
| # See: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#onpull_requestpull_request_targetpathspaths-ignore | |
| name: Go | |
| 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: | |
| code: ${{ steps.filter.outputs.code }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: dorny/paths-filter@v4 | |
| id: filter | |
| with: | |
| filters: | | |
| code: | |
| - 'api/**' | |
| - 'commands/**' | |
| - 'e2e/**' | |
| - 'internal/**' | |
| - 'pkg/**' | |
| - 'mdtogo/**' | |
| - 'scripts/**' | |
| - 'Makefile' | |
| - 'go.mod' | |
| - 'go.sum' | |
| - 'main.go' | |
| - '.github/workflows/go.yml' | |
| build-test: | |
| name: build-test-${{ matrix.runtime }} | |
| needs: changes | |
| if: needs.changes.outputs.code == 'true' | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| runtime: [docker, podman] | |
| steps: | |
| - name: Check runtime | |
| if: ${{ matrix.runtime == 'podman' }} | |
| run: | | |
| which podman | |
| podman version | |
| - name: Check out code | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: go.mod | |
| - name: Configure Git | |
| run: | | |
| git config --global user.email you@example.com | |
| git config --global user.name Your Name | |
| - name: Lint and Format | |
| run: make fix vet fmt lint | |
| - name: Test with Coverage | |
| run: make test-coverage | |
| - name: Docker Runtime Tests | |
| run: make test-docker | |
| env: | |
| KRM_FN_RUNTIME: ${{ matrix.runtime }} | |
| - name: Upload coverage report | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: coverage-report-${{ matrix.runtime }} | |
| path: ./coverage.out | |
| retention-days: 1 | |
| build-macos: | |
| name: build-macos | |
| needs: changes | |
| if: needs.changes.outputs.code == 'true' | |
| runs-on: macos-latest | |
| 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: Build | |
| run: | | |
| make build | |
| save-pr-number: | |
| name: Save PR Number | |
| if: github.event_name == 'pull_request' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Save PR number | |
| run: echo ${{ github.event.number }} > PR_NUMBER.txt | |
| - name: Archive PR number | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: PR_NUMBER | |
| path: PR_NUMBER.txt | |
| retention-days: 1 | |
| go-gate: | |
| name: go | |
| needs: [changes, build-test, build-macos] | |
| if: always() | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check results | |
| run: | | |
| # If no code 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.code }}" = "false" ]; then | |
| echo "No code changes, skipping Go tests" | |
| exit 0 | |
| fi | |
| # If any required job failed, cancelled, or skipped, fail this check. | |
| if [ "${{ needs.build-test.result }}" != "success" ] || \ | |
| [ "${{ needs.build-macos.result }}" != "success" ]; then | |
| echo "Go tests failed or did not complete" | |
| exit 1 | |
| fi | |
| echo "Go tests passed" | |