Skip to content

Commit ecb6360

Browse files
committed
Make notifcations integration test run conditional on code change detection in upstream job
This saves some container dependencies being created as the job won't be started unless the unit test suite is successful and there are detected code changes.
1 parent f8577d7 commit ecb6360

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

.github/workflows/stage-2-test.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ jobs:
3737
name: 'Tests'
3838
runs-on: ubuntu-latest
3939
timeout-minutes: 5
40+
outputs:
41+
notifications-changed: ${{ steps.notifications-changes-result.outputs.changed }}
4042

4143
services:
4244
postgres:
@@ -55,6 +57,19 @@ jobs:
5557
- name: 'Checkout code'
5658
uses: actions/checkout@v5
5759

60+
- name: Detect notifications code changes
61+
uses: dorny/paths-filter@v3
62+
id: notifications-changes
63+
with:
64+
filters: |
65+
notifications:
66+
- 'manage_breast_screening/notifications/**'
67+
68+
- name: Store notification code changes check
69+
id: notification-changes-result
70+
if: steps.notifications-changes.outputs.notifications == 'true'
71+
run: echo "changed=true" >> "$GITHUB_OUTPUT"
72+
5873
- name: Install poetry
5974
run: pipx install poetry
6075

@@ -89,6 +104,7 @@ jobs:
89104

90105
notifications-integration-test:
91106
needs: test
107+
if: jobs.test.outputs.notifications-changed == 'true'
92108
name: 'Notifications Integration Tests'
93109
runs-on: ubuntu-latest
94110
timeout-minutes: 5

0 commit comments

Comments
 (0)