diff --git a/.github/workflows/affected-tests.yml b/.github/workflows/affected-tests.yml index 00cddfef..cb673c7c 100644 --- a/.github/workflows/affected-tests.yml +++ b/.github/workflows/affected-tests.yml @@ -27,9 +27,6 @@ jobs: - name: Go Mod Download run: go mod download - - name: Build e2e binaries - run: | - make bin/preflight bin/support-bundle - name: Compute base ref id: pr-info @@ -159,10 +156,6 @@ jobs: PACKAGES="$pkgs" make test-packages fi - - name: Build e2e binaries - if: matrix.suite != 'unit' - run: | - make bin/preflight bin/support-bundle - name: Run e2e (filtered) - ${{ matrix.suite }} if: matrix.suite != 'unit' && steps.affected_e2e.outputs.has_changes == 'true' @@ -179,7 +172,11 @@ jobs: if [ -s "$file" ]; then regex="$(grep -v '^$' "$file" | tr '\n' '|' | sed 's/|$//')" if [ -n "$regex" ]; then - E2EPATHS="$path" RUN="^(${regex})$" make support-bundle-e2e-go-test + if [ "${{ matrix.suite }}" = "preflight" ]; then + E2EPATHS="$path" RUN="^(${regex})$" make preflight-e2e-go-test + else + E2EPATHS="$path" RUN="^(${regex})$" make support-bundle-e2e-go-test + fi else echo "No valid ${{ matrix.suite }} tests matched after filtering" fi diff --git a/Makefile b/Makefile index bb901a84..d4a0f717 100644 --- a/Makefile +++ b/Makefile @@ -84,8 +84,16 @@ run-examples: support-bundle-e2e-test: ./test/validate-support-bundle-e2e.sh +.PHONY: preflight-e2e-go-test +preflight-e2e-go-test: bin/preflight + if [ -n "$(RUN)" ]; then \ + go test ${BUILDFLAGS} ${E2EPATHS} -v -run "$(RUN)"; \ + else \ + go test ${BUILDFLAGS} ${E2EPATHS} -v; \ + fi + .PHONY: support-bundle-e2e-go-test -support-bundle-e2e-go-test: bin/preflight bin/support-bundle +support-bundle-e2e-go-test: bin/support-bundle if [ -n "$(RUN)" ]; then \ go test ${BUILDFLAGS} ${E2EPATHS} -v -run "$(RUN)"; \ else \