33 branches :
44 - main
55 pull_request :
6- paths-ignore :
7- - ' internal/librariangen/**'
86name : ci
97jobs :
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/**'
1020 build :
21+ needs : changes
22+ if : needs.changes.outputs.should_run == 'true'
1123 runs-on : ubuntu-22.04
1224 strategy :
1325 matrix :
6173 ./gradlew clean build publishToMavenLocal sourcesJar allJars
6274 popd
6375 build-java-21 :
76+ needs : changes
77+ if : needs.changes.outputs.should_run == 'true'
6478 name : " build(21) except self-service clients"
6579 # Support for Java 21 is available for all use cases except self-service clients.
6680 runs-on : ubuntu-22.04
94108 run : |
95109 bazelisk --batch test //test/integration/...
96110 build-java-25 :
111+ needs : changes
112+ if : needs.changes.outputs.should_run == 'true'
97113 name : " build(25) except self-service clients"
98114 # Support for Java 25 is available for all use cases except self-service clients.
99115 runs-on : ubuntu-22.04
@@ -128,6 +144,8 @@ jobs:
128144 run : |
129145 bazelisk --batch test //test/integration/... --jvmopt=-Dcom.google.testing.junit.runner.shouldInstallTestSecurityManager=false
130146 build-java8-except-gapic-generator-java :
147+ needs : changes
148+ if : needs.changes.outputs.should_run == 'true'
131149 name : " build(8) except for gapic-generator-java"
132150 runs-on : ubuntu-22.04
133151 steps :
@@ -174,6 +192,8 @@ jobs:
174192 GOOGLE_SDK_JAVA_LOGGING : true
175193
176194 build-java8-gapic-generator-java :
195+ needs : changes
196+ if : needs.changes.outputs.should_run == 'true'
177197 name : " build(8) for gapic-generator-java"
178198 runs-on : ubuntu-22.04
179199 steps :
@@ -221,6 +241,8 @@ jobs:
221241 popd
222242
223243 lint :
244+ needs : changes
245+ if : needs.changes.outputs.should_run == 'true'
224246 runs-on : ubuntu-22.04
225247 steps :
226248 - uses : actions/checkout@v4
@@ -235,6 +257,8 @@ jobs:
235257 run : mvn -B -ntp fmt:check
236258
237259 compatibility :
260+ needs : changes
261+ if : needs.changes.outputs.should_run == 'true'
238262 runs-on : ubuntu-22.04
239263 steps :
240264 - uses : actions/checkout@v4
@@ -250,6 +274,8 @@ jobs:
250274 run : mvn package clirr:check -DskipTests -Dfmt.skip
251275
252276 build-java8-showcase :
277+ needs : changes
278+ if : needs.changes.outputs.should_run == 'true'
253279 name : " build(8) for showcase"
254280 runs-on : ubuntu-22.04
255281 steps :
@@ -306,6 +332,8 @@ jobs:
306332 --batch-mode \
307333 --no-transfer-progress
308334 showcase :
335+ needs : changes
336+ if : needs.changes.outputs.should_run == 'true'
309337 runs-on : ubuntu-22.04
310338 strategy :
311339 matrix :
@@ -376,7 +404,8 @@ jobs:
376404 --no-transfer-progress
377405
378406 showcase-clirr :
379- 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' }}
380409 runs-on : ubuntu-22.04
381410 steps :
382411 - name : Checkout @ target branch
@@ -407,6 +436,8 @@ jobs:
407436 mvn clirr:check -B -ntp -Dclirr.skip=false -DcomparisonVersion=$SHOWCASE_CLIENT_VERSION
408437
409438 gapic-generator-java-bom :
439+ needs : changes
440+ if : needs.changes.outputs.should_run == 'true'
410441 runs-on : ubuntu-22.04
411442 steps :
412443 - uses : actions/checkout@v4
@@ -424,6 +455,8 @@ jobs:
424455 bom-path : gapic-generator-java-bom/pom.xml
425456
426457 unmanaged_dependency_check :
458+ needs : changes
459+ if : needs.changes.outputs.should_run == 'true'
427460 runs-on : ubuntu-22.04
428461 steps :
429462 - uses : actions/checkout@v4
@@ -447,6 +480,8 @@ jobs:
447480 bom-path : gapic-generator-java-bom/pom.xml
448481
449482 dependency_analyzer_unit_test :
483+ needs : changes
484+ if : needs.changes.outputs.should_run == 'true'
450485 runs-on : ubuntu-22.04
451486 steps :
452487 - uses : actions/checkout@v4
@@ -460,4 +495,4 @@ jobs:
460495 - name : Unit Tests
461496 run : |
462497 mvn test --batch-mode --no-transfer-progress
463- working-directory : java-shared-dependencies/dependency-analyzer
498+ working-directory : java-shared-dependencies/dependency-analyzer
0 commit comments