Skip to content

Commit 59be603

Browse files
committed
[workflow] Fix workflow for docs and code changes
Using count in terms of what changes is more predictable than the previous method. Signed-off-by: Arif Ali <arif-ali@ubuntu.com>
1 parent 1feb6da commit 59be603

1 file changed

Lines changed: 23 additions & 22 deletions

File tree

.github/workflows/main-pipeline.yaml

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ jobs:
3939
filters:
4040
runs-on: ubuntu-latest
4141
outputs:
42-
docs: ${{ steps.filter.outputs.docs }}
43-
foreman: ${{ steps.filter.outputs.foreman }}
42+
foreman: ${{ steps.filter_foreman.outputs.foreman }}
43+
docs_count: ${{ steps.filter_docs.outputs.doc_files_count }}
44+
all_count: ${{ steps.filter_docs.outputs.all_files_count }}
4445
steps:
4546
- uses: actions/checkout@v6
4647

@@ -61,20 +62,20 @@ jobs:
6162
- uses: dorny/paths-filter@v4
6263
id: filter_docs
6364
with:
64-
predicate-quantifier: 'every'
6565
filters: |
66-
docs:
66+
all_files:
6767
- '**'
68-
- '!man/**'
69-
- '!docs/**'
70-
- '!po/**'
71-
- '!**/*.md'
72-
- '!AUTHORS'
73-
- '!LICENSE'
68+
doc_files:
69+
- 'man/**'
70+
- 'docs/**'
71+
- 'po/**'
72+
- '**/*.md'
73+
- 'AUTHORS'
74+
- 'LICENSE'
7475
7576
py_tests:
7677
needs: filters
77-
if: needs.filters.outputs.docs == 'true'
78+
if: needs.filters.outputs.all_count > needs.filters.outputs.docs_count
7879
strategy:
7980
matrix:
8081
py_version: [ '3.9', '3.x' ]
@@ -84,7 +85,7 @@ jobs:
8485

8586
build_deb:
8687
needs: [filters, setup]
87-
if: needs.filters.outputs.docs == 'true'
88+
if: needs.filters.outputs.all_count > needs.filters.outputs.docs_count
8889
strategy:
8990
matrix:
9091
distro: ${{ fromJson(needs.setup.outputs.distros) }}
@@ -94,7 +95,7 @@ jobs:
9495

9596
build_rpm:
9697
needs: [filters, setup]
97-
if: needs.filters.outputs.docs == 'true'
98+
if: needs.filters.outputs.all_count > needs.filters.outputs.docs_count
9899
strategy:
99100
matrix:
100101
distro: ${{ fromJson(needs.setup.outputs.rpm_matrix) }}
@@ -107,26 +108,26 @@ jobs:
107108

108109
build_snap:
109110
needs: [filters, setup]
110-
if: needs.filters.outputs.docs == 'true'
111+
if: needs.filters.outputs.all_count > needs.filters.outputs.docs_count
111112
uses: ./.github/workflows/build-snap.yaml
112113

113114
flake8:
114115
needs: filters
115-
if: needs.filters.outputs.docs == 'true'
116+
if: needs.filters.outputs.all_count > needs.filters.outputs.docs_count
116117
uses: ./.github/workflows/tox.yaml
117118
with:
118119
test_name: flake8
119120

120121
pylint:
121122
needs: filters
122-
if: needs.filters.outputs.docs == 'true'
123+
if: needs.filters.outputs.all_count > needs.filters.outputs.docs_count
123124
uses: ./.github/workflows/tox.yaml
124125
with:
125126
test_name: pylint
126127

127128
unit:
128129
needs: [filters, setup, build_deb, build_snap]
129-
if: needs.filters.outputs.docs == 'true'
130+
if: needs.filters.outputs.all_count > needs.filters.outputs.docs_count
130131
strategy:
131132
matrix:
132133
distro: ${{ fromJson(needs.setup.outputs.distros) }}
@@ -140,7 +141,7 @@ jobs:
140141

141142
unit_rpm:
142143
needs: [filters, setup, build_rpm]
143-
if: needs.filters.outputs.docs == 'true'
144+
if: needs.filters.outputs.all_count > needs.filters.outputs.docs_count
144145
strategy:
145146
matrix:
146147
distros: ${{ fromJson(needs.setup.outputs.rpm_matrix) }}
@@ -155,7 +156,7 @@ jobs:
155156

156157
stage_one:
157158
needs: [filters, setup, build_deb, build_snap, unit]
158-
if: needs.filters.outputs.docs == 'true'
159+
if: needs.filters.outputs.all_count > needs.filters.outputs.docs_count
159160
strategy:
160161
matrix:
161162
distro: ${{ fromJson(needs.setup.outputs.distros) }}
@@ -171,7 +172,7 @@ jobs:
171172

172173
stage_one_rpm:
173174
needs: [filters, setup, build_rpm, unit_rpm]
174-
if: needs.filters.outputs.docs == 'true'
175+
if: needs.filters.outputs.all_count > needs.filters.outputs.docs_count
175176
strategy:
176177
matrix:
177178
distros: ${{ fromJson(needs.setup.outputs.rpm_matrix) }}
@@ -187,7 +188,7 @@ jobs:
187188

188189
stage_two:
189190
needs: [filters, setup, build_deb, build_snap, stage_one]
190-
if: needs.filters.outputs.docs == 'true'
191+
if: needs.filters.outputs.all_count > needs.filters.outputs.docs_count
191192
strategy:
192193
matrix:
193194
distro: ${{ fromJson(needs.setup.outputs.distros) }}
@@ -202,7 +203,7 @@ jobs:
202203

203204
stage_two_rpm:
204205
needs: [filters, setup, build_rpm, stage_one_rpm]
205-
if: needs.filters.outputs.docs == 'true'
206+
if: needs.filters.outputs.all_count > needs.filters.outputs.docs_count
206207
strategy:
207208
matrix:
208209
distros: ${{ fromJson(needs.setup.outputs.centos_matrix) }}

0 commit comments

Comments
 (0)