From 2d664b8736d4448ba5617366406ef1dd0597d64b Mon Sep 17 00:00:00 2001 From: Noah Campbell Date: Mon, 13 Oct 2025 09:44:39 -0500 Subject: [PATCH] separated build and test actions for relevant tests --- .../workflows/{build-test.yaml => build.yaml} | 65 ++----------------- .github/workflows/push-full-tests.yml | 47 ++++++++++++++ 2 files changed, 53 insertions(+), 59 deletions(-) rename .github/workflows/{build-test.yaml => build.yaml} (65%) create mode 100644 .github/workflows/push-full-tests.yml diff --git a/.github/workflows/build-test.yaml b/.github/workflows/build.yaml similarity index 65% rename from .github/workflows/build-test.yaml rename to .github/workflows/build.yaml index 9e5af070..2ad6570d 100644 --- a/.github/workflows/build-test.yaml +++ b/.github/workflows/build.yaml @@ -1,4 +1,4 @@ -name: build-test +name: build on: pull_request: @@ -78,22 +78,7 @@ jobs: make vet # Unit and integration tests - test: - if: github.event_name == 'push' && needs.changes.outputs.go-files == 'true' - needs: [changes, lint] - runs-on: ubuntu-latest - timeout-minutes: 20 - steps: - - uses: actions/checkout@v5 - - uses: ./.github/actions/setup-go - - - name: Setup K3s - uses: replicatedhq/action-k3s@main - with: - version: v1.31.2-k3s1 - - - name: Run tests - run: make test-integration + # (moved to push-full-tests.yml) # Build binaries build: @@ -124,64 +109,26 @@ jobs: path: bin/ retention-days: 1 - # E2E tests - e2e: - if: github.event_name == 'push' - needs: [changes, build] - runs-on: ubuntu-latest - timeout-minutes: 15 - strategy: - fail-fast: false - matrix: - include: - - name: preflight - target: preflight-e2e-test - needs-k3s: true - - name: support-bundle-shell - target: support-bundle-e2e-test - needs-k3s: true - - name: support-bundle-go - target: support-bundle-e2e-go-test - needs-k3s: false - steps: - - uses: actions/checkout@v5 - - - name: Setup K3s - if: matrix.needs-k3s - uses: replicatedhq/action-k3s@main - with: - version: v1.31.2-k3s1 - - - uses: actions/download-artifact@v4 - with: - name: binaries - path: bin/ - - - run: chmod +x bin/* - - run: make ${{ matrix.target }} + # (moved to push-full-tests.yml) # Success summary success: if: always() - needs: [lint, test, build, e2e] + needs: [lint, build] runs-on: ubuntu-latest steps: - name: Check results run: | # Check if any required jobs failed if [[ "${{ needs.lint.result }}" == "failure" ]] || \ - [[ "${{ needs.test.result }}" == "failure" ]] || \ - [[ "${{ needs.build.result }}" == "failure" ]] || \ - [[ "${{ needs.e2e.result }}" == "failure" ]]; then + [[ "${{ needs.build.result }}" == "failure" ]]; then echo "::error::Some jobs failed or were cancelled" exit 1 fi # Check if any required jobs were cancelled if [[ "${{ needs.lint.result }}" == "cancelled" ]] || \ - [[ "${{ needs.test.result }}" == "cancelled" ]] || \ - [[ "${{ needs.build.result }}" == "cancelled" ]] || \ - [[ "${{ needs.e2e.result }}" == "cancelled" ]]; then + [[ "${{ needs.build.result }}" == "cancelled" ]]; then echo "::error::Some jobs failed or were cancelled" exit 1 fi diff --git a/.github/workflows/push-full-tests.yml b/.github/workflows/push-full-tests.yml new file mode 100644 index 00000000..3228be76 --- /dev/null +++ b/.github/workflows/push-full-tests.yml @@ -0,0 +1,47 @@ +name: push-full-tests + +on: + push: + branches: [main] + +jobs: + unit-integration: + runs-on: ubuntu-latest + timeout-minutes: 20 + steps: + - uses: actions/checkout@v5 + - uses: ./.github/actions/setup-go + - name: Setup K3s + uses: replicatedhq/action-k3s@main + with: + version: v1.31.2-k3s1 + - name: Run tests + run: make test-integration + + e2e: + needs: unit-integration + runs-on: ubuntu-latest + timeout-minutes: 15 + strategy: + fail-fast: false + matrix: + include: + - name: preflight + target: preflight-e2e-test + needs-k3s: true + - name: support-bundle-shell + target: support-bundle-e2e-test + needs-k3s: true + - name: support-bundle-go + target: support-bundle-e2e-go-test + needs-k3s: false + steps: + - uses: actions/checkout@v5 + - name: Setup K3s + if: matrix.needs-k3s + uses: replicatedhq/action-k3s@main + with: + version: v1.31.2-k3s1 + - run: make ${{ matrix.target }} + +