55 pull_request :
66name : ci
77jobs :
8+ changes :
9+ runs-on : ubuntu-latest
10+ outputs :
11+ should_run : ${{ steps.filter.outputs.should_run }}
12+ steps :
13+ - uses : actions/checkout@v4
14+ - uses : dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36
15+ id : filter
16+ with :
17+ filters : |
18+ should_run:
19+ - '!internal/librariangen/**'
820 build :
21+ needs : changes
22+ if : needs.changes.outputs.should_run == 'true'
923 runs-on : ubuntu-22.04
1024 strategy :
1125 matrix :
5973 ./gradlew clean build publishToMavenLocal sourcesJar allJars
6074 popd
6175 build-java-21 :
76+ needs : changes
77+ if : needs.changes.outputs.should_run == 'true'
6278 name : " build(21) except self-service clients"
6379 # Support for Java 21 is available for all use cases except self-service clients.
6480 runs-on : ubuntu-22.04
92108 run : |
93109 bazelisk --batch test //test/integration/...
94110 build-java-25 :
111+ needs : changes
112+ if : needs.changes.outputs.should_run == 'true'
95113 name : " build(25) except self-service clients"
96114 # Support for Java 25 is available for all use cases except self-service clients.
97115 runs-on : ubuntu-22.04
@@ -126,6 +144,8 @@ jobs:
126144 run : |
127145 bazelisk --batch test //test/integration/... --jvmopt=-Dcom.google.testing.junit.runner.shouldInstallTestSecurityManager=false
128146 build-java8-except-gapic-generator-java :
147+ needs : changes
148+ if : needs.changes.outputs.should_run == 'true'
129149 name : " build(8) except for gapic-generator-java"
130150 runs-on : ubuntu-22.04
131151 steps :
@@ -172,6 +192,8 @@ jobs:
172192 GOOGLE_SDK_JAVA_LOGGING : true
173193
174194 build-java8-gapic-generator-java :
195+ needs : changes
196+ if : needs.changes.outputs.should_run == 'true'
175197 name : " build(8) for gapic-generator-java"
176198 runs-on : ubuntu-22.04
177199 steps :
@@ -219,6 +241,8 @@ jobs:
219241 popd
220242
221243 lint :
244+ needs : changes
245+ if : needs.changes.outputs.should_run == 'true'
222246 runs-on : ubuntu-22.04
223247 steps :
224248 - uses : actions/checkout@v4
@@ -233,6 +257,8 @@ jobs:
233257 run : mvn -B -ntp fmt:check
234258
235259 compatibility :
260+ needs : changes
261+ if : needs.changes.outputs.should_run == 'true'
236262 runs-on : ubuntu-22.04
237263 steps :
238264 - uses : actions/checkout@v4
@@ -248,6 +274,8 @@ jobs:
248274 run : mvn package clirr:check -DskipTests -Dfmt.skip
249275
250276 build-java8-showcase :
277+ needs : changes
278+ if : needs.changes.outputs.should_run == 'true'
251279 name : " build(8) for showcase"
252280 runs-on : ubuntu-22.04
253281 steps :
@@ -304,6 +332,8 @@ jobs:
304332 --batch-mode \
305333 --no-transfer-progress
306334 showcase :
335+ needs : changes
336+ if : needs.changes.outputs.should_run == 'true'
307337 runs-on : ubuntu-22.04
308338 strategy :
309339 matrix :
@@ -374,7 +404,8 @@ jobs:
374404 --no-transfer-progress
375405
376406 showcase-clirr :
377- if : ${{ github.base_ref != '' }} # Only execute on pull_request trigger event
407+ needs : changes
408+ if : ${{ github.base_ref != '' && needs.changes.outputs.should_run == 'true' }}
378409 runs-on : ubuntu-22.04
379410 steps :
380411 - name : Checkout @ target branch
@@ -405,6 +436,8 @@ jobs:
405436 mvn clirr:check -B -ntp -Dclirr.skip=false -DcomparisonVersion=$SHOWCASE_CLIENT_VERSION
406437
407438 gapic-generator-java-bom :
439+ needs : changes
440+ if : needs.changes.outputs.should_run == 'true'
408441 runs-on : ubuntu-22.04
409442 steps :
410443 - uses : actions/checkout@v4
@@ -422,6 +455,8 @@ jobs:
422455 bom-path : gapic-generator-java-bom/pom.xml
423456
424457 unmanaged_dependency_check :
458+ needs : changes
459+ if : needs.changes.outputs.should_run == 'true'
425460 runs-on : ubuntu-22.04
426461 steps :
427462 - uses : actions/checkout@v4
@@ -445,6 +480,8 @@ jobs:
445480 bom-path : gapic-generator-java-bom/pom.xml
446481
447482 dependency_analyzer_unit_test :
483+ needs : changes
484+ if : needs.changes.outputs.should_run == 'true'
448485 runs-on : ubuntu-22.04
449486 steps :
450487 - uses : actions/checkout@v4
@@ -458,4 +495,4 @@ jobs:
458495 - name : Unit Tests
459496 run : |
460497 mvn test --batch-mode --no-transfer-progress
461- working-directory : java-shared-dependencies/dependency-analyzer
498+ working-directory : java-shared-dependencies/dependency-analyzer
0 commit comments