Skip to content

Commit f95036b

Browse files
hakmanCiprian Hacman
authored and
Ciprian Hacman
committed
Skip tests-e2e-scenarios-bare-metal when version.go changes
1 parent a6c7599 commit f95036b

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

.github/workflows/e2e.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
2121
with:
2222
path: ${{ env.GOPATH }}/src/k8s.io/kops
23+
fetch-depth: 2
2324

2425
- name: Set up go
2526
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b
@@ -29,9 +30,17 @@ jobs:
2930
- name: tests/e2e/scenarios/bare-metal/run-test
3031
working-directory: ${{ env.GOPATH }}/src/k8s.io/kops
3132
run: |
32-
timeout 60m tests/e2e/scenarios/bare-metal/run-test
33+
CHANGED_VERSION=$(git diff --name-only HEAD~1 | grep -E '^kops-version\.go$')
34+
if [ -z "${CHANGED_VERSION}" ]
35+
then
36+
echo "running metal test"
37+
timeout 60m tests/e2e/scenarios/bare-metal/run-test
38+
else
39+
echo "kops-version.go has been modified, skipping metal test"
40+
fi
3341
env:
3442
ARTIFACTS: /tmp/artifacts
43+
3544
- name: Archive production artifacts
3645
if: always()
3746
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)