Skip to content

Commit a050688

Browse files
authored
Attempt fix for scheduled events failure on filter. (#11232)
1 parent 5a575e4 commit a050688

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed

.github/workflows/gradle.yml

+19-7
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ jobs:
2222
# The output of this job is used to trigger the following builds.
2323
changes:
2424
name: "Detect Modified Files"
25+
# The filtering action does not deal with well scheduled events so skip to avoid errors.
26+
# See https://github.com/dorny/paths-filter/issues/100 for more info.
27+
# This is okay this workflow is only scheduled on master, where we want to build everything
28+
# so filtering is not required. Use always() in each start block to force the start task.
29+
if: github.event_name != 'schedule'
2530
runs-on: ubuntu-latest
2631
outputs:
2732
backend: ${{ steps.filter.outputs.backend }}
@@ -70,7 +75,8 @@ jobs:
7075
octavia-cli-build:
7176
needs: changes
7277
runs-on: ubuntu-latest
73-
if: needs.changes.outputs.cli == 'true' || needs.changes.outputs.build == 'true' || github.ref == 'refs/heads/master'
78+
# Because scheduled builds on master require us to skip the changes job. Use always() to force this to run on master.
79+
if: needs.changes.outputs.cli == 'true' || needs.changes.outputs.build == 'true' || (always() && github.ref == 'refs/heads/master')
7480
name: "Octavia CLI: Build"
7581
timeout-minutes: 90
7682
steps:
@@ -141,9 +147,10 @@ jobs:
141147
start-connectors-base-build-runner:
142148
name: "Connectors Base: Start Build EC2 Runner"
143149
needs: changes
150+
# Because scheduled builds on master require us to skip the changes job. Use always() to force this to run on master.
144151
if: |
145152
needs.changes.outputs.build == 'true' || needs.changes.outputs.connectors == 'true' || needs.changes.outputs.db == 'true'
146-
|| github.ref == 'refs/heads/master'
153+
|| (always() && github.ref == 'refs/heads/master')
147154
timeout-minutes: 10
148155
runs-on: ubuntu-latest
149156
outputs:
@@ -265,9 +272,10 @@ jobs:
265272
start-frontend-test-runner:
266273
name: "Frontend: Start Test EC2 Runner"
267274
needs: changes
275+
# Because scheduled builds on master require us to skip the changes job. Use always() to force this to run on master.
268276
if: |
269277
needs.changes.outputs.frontend == 'true' || needs.changes.outputs.build == 'true' || github.ref == 'refs/heads/master'
270-
|| needs.changes.outputs.backend == 'true'
278+
|| (always() && needs.changes.outputs.backend == 'true')
271279
timeout-minutes: 10
272280
runs-on: ubuntu-latest
273281
outputs:
@@ -359,7 +367,8 @@ jobs:
359367
start-platform-build-runner:
360368
name: "Platform: Start Build EC2 Runner"
361369
needs: changes
362-
if: needs.changes.outputs.backend == 'true' || needs.changes.outputs.build == 'true' || github.ref == 'refs/heads/master'
370+
# Because scheduled builds on master require us to skip the changes job. Use always() to force this to run on master.
371+
if: needs.changes.outputs.backend == 'true' || needs.changes.outputs.build == 'true' || (always() && github.ref == 'refs/heads/master')
363372
timeout-minutes: 10
364373
runs-on: ubuntu-latest
365374
outputs:
@@ -497,7 +506,8 @@ jobs:
497506
start-platform-new-scheduler-acceptance-runner:
498507
name: "Platform: Start Docker w/ Scheduler v2 Test Runner"
499508
needs: changes
500-
if: needs.changes.outputs.backend == 'true' || needs.changes.outputs.build == 'true' || github.ref == 'refs/heads/master'
509+
# Because scheduled builds on master require us to skip the changes job. Use always() to force this to run on master.
510+
if: needs.changes.outputs.backend == 'true' || needs.changes.outputs.build == 'true' || (always() && github.ref == 'refs/heads/master')
501511
timeout-minutes: 10
502512
runs-on: ubuntu-latest
503513
outputs:
@@ -621,7 +631,8 @@ jobs:
621631
start-kube-acceptance-test-runner:
622632
name: "Platform: Start Kube Acceptance Test EC2 Runner"
623633
needs: changes
624-
if: needs.changes.outputs.backend == 'true' || needs.changes.outputs.build == 'true' || github.ref == 'refs/heads/master'
634+
# Because scheduled builds on master require us to skip the changes job. Use always() to force this to run on master.
635+
if: needs.changes.outputs.backend == 'true' || needs.changes.outputs.build == 'true' || (always() && github.ref == 'refs/heads/master')
625636
timeout-minutes: 10
626637
runs-on: ubuntu-latest
627638
outputs:
@@ -786,7 +797,8 @@ jobs:
786797
start-kube-acceptance-test-runner-v2:
787798
name: "Platform: Start Scheduler V2 Kube Acceptance Test Runner"
788799
needs: changes
789-
if: needs.changes.outputs.backend == 'true' || needs.changes.outputs.build == 'true' || github.ref == 'refs/heads/master'
800+
# Because scheduled builds on master require us to skip the changes job. Use always() to force this to run on master.
801+
if: needs.changes.outputs.backend == 'true' || needs.changes.outputs.build == 'true' || (always() && github.ref == 'refs/heads/master')
790802
timeout-minutes: 10
791803
runs-on: ubuntu-latest
792804
outputs:

0 commit comments

Comments
 (0)