Skip to content

Commit a88b532

Browse files
authored
feat: Cleans up before and after Test Suite so they don't interfere (#1695)
* don't schedule clean-up job as it'll be called from Test Suite * run clean before and after * secrets inherit
1 parent 31ffd15 commit a88b532

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

.github/workflows/cleanup-test-env.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
name: 'Cleanup test env'
22

33
on:
4-
workflow_dispatch: {} # workflow can be run manually
5-
schedule:
6-
- cron: "0 3 * * *" # workflow runs every day at 03:00 AM
4+
workflow_dispatch: # workflow can be run manually
5+
workflow_call: # workflow runs from Test Suite
76

87
jobs:
98
cleanup-test-env-general:

.github/workflows/test-suite.yml

+14-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,13 @@ on:
77

88
jobs:
99

10+
clean-before:
11+
secrets: inherit
12+
uses: ./.github/workflows/cleanup-test-env.yml
13+
1014
mig-tests:
15+
needs: clean-before
16+
if: ${{ !cancelled() }}
1117
strategy:
1218
max-parallel: 1
1319
fail-fast: false
@@ -23,7 +29,7 @@ jobs:
2329

2430
acc-tests:
2531
needs: mig-tests
26-
if: ${{ !cancelled() }} # run acc tests even if mig tests fail
32+
if: ${{ !cancelled() }}
2733
strategy:
2834
max-parallel: 1
2935
fail-fast: false
@@ -34,3 +40,10 @@ jobs:
3440
uses: ./.github/workflows/acceptance-tests.yml
3541
with:
3642
terraform_version: ${{ matrix.terraform_version }}
43+
44+
clean-after:
45+
needs: acc-tests
46+
if: ${{ !cancelled() }}
47+
secrets: inherit
48+
uses: ./.github/workflows/cleanup-test-env.yml
49+

0 commit comments

Comments
 (0)