diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 10f4dbb939e74..5474d31ed2136 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -20,6 +20,7 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 with: path: ${{ env.GOPATH }}/src/k8s.io/kops + fetch-depth: 2 - name: Set up go uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b @@ -29,9 +30,17 @@ jobs: - name: tests/e2e/scenarios/bare-metal/run-test working-directory: ${{ env.GOPATH }}/src/k8s.io/kops run: | - timeout 60m tests/e2e/scenarios/bare-metal/run-test + CHANGED_VERSION=$(git diff --name-only HEAD~1 | grep -E '^kops-version\.go$') + if [ -z "${CHANGED_VERSION}" ] + then + echo "running metal test" + timeout 60m tests/e2e/scenarios/bare-metal/run-test + else + echo "kops-version.go has been modified, skipping metal test" + fi env: ARTIFACTS: /tmp/artifacts + - name: Archive production artifacts if: always() uses: actions/upload-artifact@v4