@@ -8,6 +8,29 @@ name: Pull request
88' on ' :
99 pull_request :
1010jobs :
11+ # Detect which files have changed and use this to run jobs conditionally.
12+ # Note that we can't use the workflow-level paths attribute since this
13+ # would skip the workflow entirely, and would prevent us from making the
14+ # aio jobs required to pass (a skip counts as a pass).
15+ check-changes :
16+ runs-on : ubuntu-20.04
17+ permissions :
18+ pull-requests : read
19+ name : Check changed files
20+ if : github.repository == 'stackhpc/stackhpc-kayobe-config'
21+ outputs :
22+ aio : ${{ steps.changes.outputs.aio }}
23+ steps :
24+ - name : GitHub Checkout
25+ uses : actions/checkout@v3
26+
27+ - name : Check changed files
28+ uses : dorny/paths-filter@v2
29+ id : changes
30+ with :
31+ # Filters are defined in this file.
32+ filters : .github/path-filters.yml
33+
1134 tox :
1235 runs-on : ubuntu-20.04
1336 permissions : {}
@@ -36,38 +59,55 @@ jobs:
3659 - name : Run Tox ${{ matrix.environment }} 🧪
3760 run : tox -e ${{ matrix.environment }}
3861
62+ # A skipped job is treated as success when used as a required status check.
63+ # The registered required status checks refer to the name of the job in the
64+ # called reusable workflow rather than the jobs in this file. The following
65+ # jobs need to run unconditionally to allow GitHub required status checks to
66+ # pass even when there are changed files. The `! failure()` condition runs
67+ # when the parent jobs completed successfully or were skipped. We pass an
68+ # 'if' argument to the called workflow to allow running it conditionally.
69+
3970 build-kayobe-image :
4071 name : Build Kayobe Image
72+ needs :
73+ - check-changes
4174 uses : ./.github/workflows/stackhpc-build-kayobe-image.yml
75+ with :
76+ if : ${{ needs.check-changes.outputs.aio == 'true' }}
4277 if : github.repository == 'stackhpc/stackhpc-kayobe-config'
4378
4479 all-in-one-centos-ovs :
4580 name : aio (CentOS OVS)
4681 needs :
82+ - check-changes
4783 - build-kayobe-image
4884 uses : ./.github/workflows/stackhpc-all-in-one.yml
4985 with :
5086 kayobe_image : ${{ needs.build-kayobe-image.outputs.kayobe_image }}
5187 neutron_plugin : ovs
5288 OS_CLOUD : sms-lab-release
89+ if : ${{ needs.check-changes.outputs.aio == 'true' }}
5390 secrets : inherit
54- if : github.repository == 'stackhpc/stackhpc-kayobe-config'
91+ if : ${{ ! failure() && github.repository == 'stackhpc/stackhpc-kayobe-config' }}
5592
5693 all-in-one-centos-ovn :
5794 name : aio (CentOS OVN)
5895 needs :
96+ - check-changes
5997 - build-kayobe-image
6098 uses : ./.github/workflows/stackhpc-all-in-one.yml
6199 with :
62100 kayobe_image : ${{ needs.build-kayobe-image.outputs.kayobe_image }}
63101 neutron_plugin : ovn
64102 OS_CLOUD : sms-lab-release
103+ if : ${{ needs.check-changes.outputs.aio == 'true' }}
65104 secrets : inherit
66- if : github.repository == 'stackhpc/stackhpc-kayobe-config'
105+ if : ${{ ! failure() && github.repository == 'stackhpc/stackhpc-kayobe-config' }}
67106
68107 all-in-one-rocky-8-ovs :
69108 name : aio (Rocky OVS)
70109 needs :
110+ - check-changes
71111 - build-kayobe-image
72112 uses : ./.github/workflows/stackhpc-all-in-one.yml
73113 with :
@@ -76,12 +116,14 @@ jobs:
76116 os_release : " 8"
77117 neutron_plugin : ovs
78118 OS_CLOUD : sms-lab-release
119+ if : ${{ needs.check-changes.outputs.aio == 'true' }}
79120 secrets : inherit
80- if : github.repository == 'stackhpc/stackhpc-kayobe-config'
121+ if : ${{ ! failure() && github.repository == 'stackhpc/stackhpc-kayobe-config' }}
81122
82123 all-in-one-rocky-8-ovn :
83124 name : aio (Rocky OVN)
84125 needs :
126+ - check-changes
85127 - build-kayobe-image
86128 uses : ./.github/workflows/stackhpc-all-in-one.yml
87129 with :
@@ -90,12 +132,14 @@ jobs:
90132 os_release : " 8"
91133 neutron_plugin : ovn
92134 OS_CLOUD : sms-lab-release
135+ if : ${{ needs.check-changes.outputs.aio == 'true' }}
93136 secrets : inherit
94- if : github.repository == 'stackhpc/stackhpc-kayobe-config'
137+ if : ${{ ! failure() && github.repository == 'stackhpc/stackhpc-kayobe-config' }}
95138
96139 all-in-one-ubuntu-ovs :
97140 name : aio (Ubuntu OVS)
98141 needs :
142+ - check-changes
99143 - build-kayobe-image
100144 uses : ./.github/workflows/stackhpc-all-in-one.yml
101145 with :
@@ -105,12 +149,14 @@ jobs:
105149 ssh_username : ubuntu
106150 neutron_plugin : ovs
107151 OS_CLOUD : sms-lab-release
152+ if : ${{ needs.check-changes.outputs.aio == 'true' }}
108153 secrets : inherit
109- if : github.repository == 'stackhpc/stackhpc-kayobe-config'
154+ if : ${{ ! failure() && github.repository == 'stackhpc/stackhpc-kayobe-config' }}
110155
111156 all-in-one-ubuntu-ovn :
112157 name : aio (Ubuntu OVN)
113158 needs :
159+ - check-changes
114160 - build-kayobe-image
115161 uses : ./.github/workflows/stackhpc-all-in-one.yml
116162 with :
@@ -120,12 +166,14 @@ jobs:
120166 ssh_username : ubuntu
121167 neutron_plugin : ovn
122168 OS_CLOUD : sms-lab-release
169+ if : ${{ needs.check-changes.outputs.aio == 'true' }}
123170 secrets : inherit
124- if : github.repository == 'stackhpc/stackhpc-kayobe-config'
171+ if : ${{ ! failure() && github.repository == 'stackhpc/stackhpc-kayobe-config' }}
125172
126173 all-in-one-ubuntu-jammy-ovs :
127174 name : aio (Ubuntu Jammy OVS)
128175 needs :
176+ - check-changes
129177 - build-kayobe-image
130178 uses : ./.github/workflows/stackhpc-all-in-one.yml
131179 with :
@@ -135,12 +183,14 @@ jobs:
135183 ssh_username : ubuntu
136184 neutron_plugin : ovs
137185 OS_CLOUD : sms-lab-release
186+ if : ${{ needs.check-changes.outputs.aio == 'true' }}
138187 secrets : inherit
139- if : github.repository == 'stackhpc/stackhpc-kayobe-config'
188+ if : ${{ ! failure() && github.repository == 'stackhpc/stackhpc-kayobe-config' }}
140189
141190 all-in-one-ubuntu-jammy-ovn :
142191 name : aio (Ubuntu Jammy OVN)
143192 needs :
193+ - check-changes
144194 - build-kayobe-image
145195 uses : ./.github/workflows/stackhpc-all-in-one.yml
146196 with :
@@ -150,12 +200,14 @@ jobs:
150200 ssh_username : ubuntu
151201 neutron_plugin : ovn
152202 OS_CLOUD : sms-lab-release
203+ if : ${{ needs.check-changes.outputs.aio == 'true' }}
153204 secrets : inherit
154- if : github.repository == 'stackhpc/stackhpc-kayobe-config'
205+ if : ${{ ! failure() && github.repository == 'stackhpc/stackhpc-kayobe-config' }}
155206
156207 all-in-one-rocky-9-ovs :
157208 name : aio (Rocky 9 OVS)
158209 needs :
210+ - check-changes
159211 - build-kayobe-image
160212 uses : ./.github/workflows/stackhpc-all-in-one.yml
161213 with :
@@ -165,12 +217,14 @@ jobs:
165217 ssh_username : cloud-user
166218 neutron_plugin : ovs
167219 OS_CLOUD : sms-lab-release
220+ if : ${{ needs.check-changes.outputs.aio == 'true' }}
168221 secrets : inherit
169- if : github.repository == 'stackhpc/stackhpc-kayobe-config'
222+ if : ${{ ! failure() && github.repository == 'stackhpc/stackhpc-kayobe-config' }}
170223
171224 all-in-one-rocky-9-ovn :
172225 name : aio (Rocky 9 OVN)
173226 needs :
227+ - check-changes
174228 - build-kayobe-image
175229 uses : ./.github/workflows/stackhpc-all-in-one.yml
176230 with :
@@ -180,5 +234,6 @@ jobs:
180234 ssh_username : cloud-user
181235 neutron_plugin : ovn
182236 OS_CLOUD : sms-lab-release
237+ if : ${{ needs.check-changes.outputs.aio == 'true' }}
183238 secrets : inherit
184- if : github.repository == 'stackhpc/stackhpc-kayobe-config'
239+ if : ${{ ! failure() && github.repository == 'stackhpc/stackhpc-kayobe-config' }}
0 commit comments