@@ -8,6 +8,29 @@ name: Pull request
8
8
' on ' :
9
9
pull_request :
10
10
jobs :
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
+
11
34
tox :
12
35
runs-on : ubuntu-20.04
13
36
permissions : {}
@@ -36,38 +59,55 @@ jobs:
36
59
- name : Run Tox ${{ matrix.environment }} 🧪
37
60
run : tox -e ${{ matrix.environment }}
38
61
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
+
39
70
build-kayobe-image :
40
71
name : Build Kayobe Image
72
+ needs :
73
+ - check-changes
41
74
uses : ./.github/workflows/stackhpc-build-kayobe-image.yml
75
+ with :
76
+ if : ${{ needs.check-changes.outputs.aio == 'true' }}
42
77
if : github.repository == 'stackhpc/stackhpc-kayobe-config'
43
78
44
79
all-in-one-centos-ovs :
45
80
name : aio (CentOS OVS)
46
81
needs :
82
+ - check-changes
47
83
- build-kayobe-image
48
84
uses : ./.github/workflows/stackhpc-all-in-one.yml
49
85
with :
50
86
kayobe_image : ${{ needs.build-kayobe-image.outputs.kayobe_image }}
51
87
neutron_plugin : ovs
52
88
OS_CLOUD : sms-lab-release
89
+ if : ${{ needs.check-changes.outputs.aio == 'true' }}
53
90
secrets : inherit
54
- if : github.repository == 'stackhpc/stackhpc-kayobe-config'
91
+ if : ${{ ! failure() && github.repository == 'stackhpc/stackhpc-kayobe-config' }}
55
92
56
93
all-in-one-centos-ovn :
57
94
name : aio (CentOS OVN)
58
95
needs :
96
+ - check-changes
59
97
- build-kayobe-image
60
98
uses : ./.github/workflows/stackhpc-all-in-one.yml
61
99
with :
62
100
kayobe_image : ${{ needs.build-kayobe-image.outputs.kayobe_image }}
63
101
neutron_plugin : ovn
64
102
OS_CLOUD : sms-lab-release
103
+ if : ${{ needs.check-changes.outputs.aio == 'true' }}
65
104
secrets : inherit
66
- if : github.repository == 'stackhpc/stackhpc-kayobe-config'
105
+ if : ${{ ! failure() && github.repository == 'stackhpc/stackhpc-kayobe-config' }}
67
106
68
107
all-in-one-rocky-8-ovs :
69
108
name : aio (Rocky OVS)
70
109
needs :
110
+ - check-changes
71
111
- build-kayobe-image
72
112
uses : ./.github/workflows/stackhpc-all-in-one.yml
73
113
with :
@@ -76,12 +116,14 @@ jobs:
76
116
os_release : " 8"
77
117
neutron_plugin : ovs
78
118
OS_CLOUD : sms-lab-release
119
+ if : ${{ needs.check-changes.outputs.aio == 'true' }}
79
120
secrets : inherit
80
- if : github.repository == 'stackhpc/stackhpc-kayobe-config'
121
+ if : ${{ ! failure() && github.repository == 'stackhpc/stackhpc-kayobe-config' }}
81
122
82
123
all-in-one-rocky-8-ovn :
83
124
name : aio (Rocky OVN)
84
125
needs :
126
+ - check-changes
85
127
- build-kayobe-image
86
128
uses : ./.github/workflows/stackhpc-all-in-one.yml
87
129
with :
@@ -90,12 +132,14 @@ jobs:
90
132
os_release : " 8"
91
133
neutron_plugin : ovn
92
134
OS_CLOUD : sms-lab-release
135
+ if : ${{ needs.check-changes.outputs.aio == 'true' }}
93
136
secrets : inherit
94
- if : github.repository == 'stackhpc/stackhpc-kayobe-config'
137
+ if : ${{ ! failure() && github.repository == 'stackhpc/stackhpc-kayobe-config' }}
95
138
96
139
all-in-one-ubuntu-ovs :
97
140
name : aio (Ubuntu OVS)
98
141
needs :
142
+ - check-changes
99
143
- build-kayobe-image
100
144
uses : ./.github/workflows/stackhpc-all-in-one.yml
101
145
with :
@@ -105,12 +149,14 @@ jobs:
105
149
ssh_username : ubuntu
106
150
neutron_plugin : ovs
107
151
OS_CLOUD : sms-lab-release
152
+ if : ${{ needs.check-changes.outputs.aio == 'true' }}
108
153
secrets : inherit
109
- if : github.repository == 'stackhpc/stackhpc-kayobe-config'
154
+ if : ${{ ! failure() && github.repository == 'stackhpc/stackhpc-kayobe-config' }}
110
155
111
156
all-in-one-ubuntu-ovn :
112
157
name : aio (Ubuntu OVN)
113
158
needs :
159
+ - check-changes
114
160
- build-kayobe-image
115
161
uses : ./.github/workflows/stackhpc-all-in-one.yml
116
162
with :
@@ -120,12 +166,14 @@ jobs:
120
166
ssh_username : ubuntu
121
167
neutron_plugin : ovn
122
168
OS_CLOUD : sms-lab-release
169
+ if : ${{ needs.check-changes.outputs.aio == 'true' }}
123
170
secrets : inherit
124
- if : github.repository == 'stackhpc/stackhpc-kayobe-config'
171
+ if : ${{ ! failure() && github.repository == 'stackhpc/stackhpc-kayobe-config' }}
125
172
126
173
all-in-one-ubuntu-jammy-ovs :
127
174
name : aio (Ubuntu Jammy OVS)
128
175
needs :
176
+ - check-changes
129
177
- build-kayobe-image
130
178
uses : ./.github/workflows/stackhpc-all-in-one.yml
131
179
with :
@@ -135,12 +183,14 @@ jobs:
135
183
ssh_username : ubuntu
136
184
neutron_plugin : ovs
137
185
OS_CLOUD : sms-lab-release
186
+ if : ${{ needs.check-changes.outputs.aio == 'true' }}
138
187
secrets : inherit
139
- if : github.repository == 'stackhpc/stackhpc-kayobe-config'
188
+ if : ${{ ! failure() && github.repository == 'stackhpc/stackhpc-kayobe-config' }}
140
189
141
190
all-in-one-ubuntu-jammy-ovn :
142
191
name : aio (Ubuntu Jammy OVN)
143
192
needs :
193
+ - check-changes
144
194
- build-kayobe-image
145
195
uses : ./.github/workflows/stackhpc-all-in-one.yml
146
196
with :
@@ -150,12 +200,14 @@ jobs:
150
200
ssh_username : ubuntu
151
201
neutron_plugin : ovn
152
202
OS_CLOUD : sms-lab-release
203
+ if : ${{ needs.check-changes.outputs.aio == 'true' }}
153
204
secrets : inherit
154
- if : github.repository == 'stackhpc/stackhpc-kayobe-config'
205
+ if : ${{ ! failure() && github.repository == 'stackhpc/stackhpc-kayobe-config' }}
155
206
156
207
all-in-one-rocky-9-ovs :
157
208
name : aio (Rocky 9 OVS)
158
209
needs :
210
+ - check-changes
159
211
- build-kayobe-image
160
212
uses : ./.github/workflows/stackhpc-all-in-one.yml
161
213
with :
@@ -165,12 +217,14 @@ jobs:
165
217
ssh_username : cloud-user
166
218
neutron_plugin : ovs
167
219
OS_CLOUD : sms-lab-release
220
+ if : ${{ needs.check-changes.outputs.aio == 'true' }}
168
221
secrets : inherit
169
- if : github.repository == 'stackhpc/stackhpc-kayobe-config'
222
+ if : ${{ ! failure() && github.repository == 'stackhpc/stackhpc-kayobe-config' }}
170
223
171
224
all-in-one-rocky-9-ovn :
172
225
name : aio (Rocky 9 OVN)
173
226
needs :
227
+ - check-changes
174
228
- build-kayobe-image
175
229
uses : ./.github/workflows/stackhpc-all-in-one.yml
176
230
with :
@@ -180,5 +234,6 @@ jobs:
180
234
ssh_username : cloud-user
181
235
neutron_plugin : ovn
182
236
OS_CLOUD : sms-lab-release
237
+ if : ${{ needs.check-changes.outputs.aio == 'true' }}
183
238
secrets : inherit
184
- if : github.repository == 'stackhpc/stackhpc-kayobe-config'
239
+ if : ${{ ! failure() && github.repository == 'stackhpc/stackhpc-kayobe-config' }}
0 commit comments