@@ -28,7 +28,38 @@ concurrency:
2828 cancel-in-progress : true
2929
3030jobs :
31+ changes :
32+ runs-on : ubuntu-24.04
33+ outputs :
34+ library_check : ${{ steps.filter.outputs.library_check }}
35+ lint : ${{ steps.filter.outputs.lint }}
36+ docs : ${{ steps.filter.outputs.docs }}
37+ package_and_upload_all : ${{ steps.filter.outputs.package_and_upload_all }}
38+ app_builder2 : ${{ steps.filter.outputs.app_builder2 }}
39+ tests : ${{ steps.filter.outputs.tests }}
40+ steps :
41+ - uses : actions/checkout@v4
42+ - uses : dorny/paths-filter@v3
43+ id : filter
44+ with :
45+ filters : |
46+ library_check:
47+ - '.github/workflows/library_check.yml'
48+ tests:
49+ - '.github/workflows/tests.yml'
50+ lint:
51+ - '.github/workflows/lint.yml'
52+ docs:
53+ - '.github/workflows/docs.yml'
54+ package_and_upload_all:
55+ - '.github/workflows/package_and_upload_all.yml'
56+ - '.github/workflows/package_and_upload.yml'
57+ app_builder2:
58+ - '.github/workflows/app_builder2.yml'
59+
3160 library_check_libhal_v4 :
61+ needs : changes
62+ if : ${{ needs.changes.outputs.library_check == 'true' }}
3263 uses : ./.github/workflows/library_check.yml
3364 with :
3465 library : libhal
3768 secrets : inherit
3869
3970 library_check_libhal-util :
71+ needs : changes
72+ if : ${{ needs.changes.outputs.library_check == 'true' }}
4073 uses : ./.github/workflows/library_check.yml
4174 with :
4275 library : libhal-util
@@ -45,27 +78,35 @@ jobs:
4578 secrets : inherit
4679
4780 libhal-actuator :
81+ needs : changes
82+ if : ${{ needs.changes.outputs.library_check == 'true' }}
4883 uses : ./.github/workflows/library_check.yml
4984 with :
5085 library : libhal-actuator
5186 repo : libhal/libhal-actuator
5287 secrets : inherit
5388
5489 libhal-sensor :
90+ needs : changes
91+ if : ${{ needs.changes.outputs.library_check == 'true' }}
5592 uses : ./.github/workflows/library_check.yml
5693 with :
5794 library : libhal-sensor
5895 repo : libhal/libhal-sensor
5996 secrets : inherit
6097
6198 libhal-expander :
99+ needs : changes
100+ if : ${{ needs.changes.outputs.library_check == 'true' }}
62101 uses : ./.github/workflows/library_check.yml
63102 with :
64103 library : libhal-expander
65104 repo : libhal/libhal-expander
66105 secrets : inherit
67106
68107 libhal-micromod-lint :
108+ needs : changes
109+ if : ${{ needs.changes.outputs.lint == 'true' }}
69110 uses : ./.github/workflows/lint.yml
70111 with :
71112 library : libhal-micromod
75116 secrets : inherit
76117
77118 libhal-micromod-docs :
119+ needs : changes
120+ if : ${{ needs.changes.outputs.docs == 'true' }}
78121 uses : ./.github/workflows/docs.yml
79122 with :
80123 library : libhal-micromod
@@ -83,7 +126,18 @@ jobs:
83126 repo : libhal/libhal-micromod
84127 secrets : inherit
85128
129+ strong_ptr-tests :
130+ needs : changes
131+ if : ${{ needs.changes.outputs.tests == 'true' }}
132+ uses : ./.github/workflows/tests.yml
133+ with :
134+ library : strong_ptr
135+ repo : libhal/strong_ptr
136+ secrets : inherit
137+
86138 package-strong_ptr :
139+ needs : changes
140+ if : ${{ needs.changes.outputs.package_and_upload_all == 'true' }}
87141 uses : ./.github/workflows/package_and_upload_all.yml
88142 with :
89143 library : strong_ptr
93147 secrets : inherit
94148
95149 package-libhal_v4 :
150+ needs : changes
151+ if : ${{ needs.changes.outputs.package_and_upload_all == 'true' }}
96152 uses : ./.github/workflows/package_and_upload_all.yml
97153 with :
98154 library : libhal
@@ -102,6 +158,8 @@ jobs:
102158 secrets : inherit
103159
104160 package-libhal-util :
161+ needs : changes
162+ if : ${{ needs.changes.outputs.package_and_upload_all == 'true' }}
105163 uses : ./.github/workflows/package_and_upload_all.yml
106164 with :
107165 library : libhal-util
@@ -116,6 +174,8 @@ jobs:
116174 # TODO(libhal/libhal-util#87): Add libhal-util v6
117175
118176 libhal-arm-mcu-lpc4078-demos :
177+ needs : changes
178+ if : ${{ needs.changes.outputs.app_builder2 == 'true' }}
119179 uses : ./.github/workflows/app_builder2.yml
120180 with :
121181 repo : libhal/libhal-arm-mcu
@@ -125,6 +185,8 @@ jobs:
125185 secrets : inherit
126186
127187 libhal-expander-build-latest :
188+ needs : changes
189+ if : ${{ needs.changes.outputs.app_builder2 == 'true' }}
128190 uses : ./.github/workflows/app_builder2.yml
129191 with :
130192 repo : libhal/libhal-expander
@@ -134,6 +196,8 @@ jobs:
134196 platform_profile : hal/mcu/lpc4078
135197
136198 libhal-actuator-demos-lpc4078 :
199+ needs : changes
200+ if : ${{ needs.changes.outputs.app_builder2 == 'true' }}
137201 uses : ./.github/workflows/app_builder2.yml
138202 with :
139203 repo : libhal/libhal-actuator
@@ -143,6 +207,8 @@ jobs:
143207 secrets : inherit
144208
145209 libhal-actuator-demos-lpc4074 :
210+ needs : changes
211+ if : ${{ needs.changes.outputs.app_builder2 == 'true' }}
146212 uses : ./.github/workflows/app_builder2.yml
147213 with :
148214 repo : libhal/libhal-actuator
@@ -152,6 +218,8 @@ jobs:
152218 secrets : inherit
153219
154220 libhal-starter-app-lpc4078 :
221+ needs : changes
222+ if : ${{ needs.changes.outputs.app_builder2 == 'true' }}
155223 uses : ./.github/workflows/app_builder2.yml
156224 with :
157225 repo : libhal/libhal-starter
@@ -160,6 +228,8 @@ jobs:
160228 secrets : inherit
161229
162230 libhal-starter-app-stm32f103c8 :
231+ needs : changes
232+ if : ${{ needs.changes.outputs.app_builder2 == 'true' }}
163233 uses : ./.github/workflows/app_builder2.yml
164234 with :
165235 repo : libhal/libhal-starter
@@ -168,6 +238,8 @@ jobs:
168238 secrets : inherit
169239
170240 libhal-starter-app-mod-stmt32f1-v4 :
241+ needs : changes
242+ if : ${{ needs.changes.outputs.app_builder2 == 'true' }}
171243 uses : ./.github/workflows/app_builder2.yml
172244 with :
173245 repo : libhal/libhal-starter
0 commit comments