Skip to content

Commit c72bed9

Browse files
committed
chore(sdk-platform-java): migrate and adapt GitHub Actions workflows
1 parent 56a3966 commit c72bed9

25 files changed

+258
-427
lines changed

sdk-platform-java/.github/workflows/analyze_dependency.yaml renamed to .github/workflows/sdk-platform-java-analyze_dependency.yaml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Run dependency analyzer
1+
name: sdk-platform-java Run dependency analyzer
22
on:
33
workflow_dispatch:
44
inputs:
@@ -17,8 +17,24 @@ on:
1717
description: the version of the dependency
1818
required: true
1919
type: string
20+
env:
21+
BUILD_SUBDIR: sdk-platform-java
2022
jobs:
23+
filter:
24+
runs-on: ubuntu-latest
25+
outputs:
26+
library: ${{ steps.filter.outputs.library }}
27+
steps:
28+
- uses: actions/checkout@v4
29+
- uses: dorny/paths-filter@v3
30+
id: filter
31+
with:
32+
filters: |
33+
library:
34+
- 'sdk-platform-java/**'
2135
Run-dependency-analyzer:
36+
needs: filter
37+
if: ${{ needs.filter.outputs.library == 'true' }}
2238
runs-on: ubuntu-22.04
2339
steps:
2440
- uses: actions/checkout@v4
@@ -40,4 +56,4 @@ jobs:
4056
shell: bash
4157
run: |
4258
mvn exec:java -Ddep.system=${{ github.event.inputs.system }} -Ddep.name=${{ github.event.inputs.name }} -Ddep.version=${{ github.event.inputs.version }}
43-
working-directory: java-shared-dependencies/dependency-analyzer
59+
working-directory: java-shared-dependencies/dependency-analyzer

sdk-platform-java/.github/workflows/ci.yaml renamed to .github/workflows/sdk-platform-java-ci.yaml

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,25 @@ on:
33
branches:
44
- main
55
pull_request:
6-
name: ci
6+
name: sdk-platform-java ci
7+
env:
8+
BUILD_SUBDIR: sdk-platform-java
79
jobs:
10+
filter:
11+
runs-on: ubuntu-latest
12+
outputs:
13+
library: ${{ steps.filter.outputs.library }}
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: dorny/paths-filter@v3
17+
id: filter
18+
with:
19+
filters: |
20+
library:
21+
- 'sdk-platform-java/**'
822
build:
23+
needs: filter
24+
if: ${{ needs.filter.outputs.library == 'true' }}
925
runs-on: ubuntu-22.04
1026
strategy:
1127
matrix:
@@ -59,6 +75,8 @@ jobs:
5975
./gradlew clean build publishToMavenLocal sourcesJar allJars
6076
popd
6177
build-java-21:
78+
needs: filter
79+
if: ${{ needs.filter.outputs.library == 'true' }}
6280
name: "build(21) except self-service clients"
6381
# Support for Java 21 is available for all use cases except self-service clients.
6482
runs-on: ubuntu-22.04
@@ -92,6 +110,8 @@ jobs:
92110
run: |
93111
bazelisk --batch test //test/integration/...
94112
build-java-25:
113+
needs: filter
114+
if: ${{ needs.filter.outputs.library == 'true' }}
95115
name: "build(25) except self-service clients"
96116
# Support for Java 25 is available for all use cases except self-service clients.
97117
runs-on: ubuntu-22.04
@@ -126,6 +146,8 @@ jobs:
126146
run: |
127147
bazelisk --batch test //test/integration/... --jvmopt=-Dcom.google.testing.junit.runner.shouldInstallTestSecurityManager=false
128148
build-java8-except-gapic-generator-java:
149+
needs: filter
150+
if: ${{ needs.filter.outputs.library == 'true' }}
129151
name: "build(8) except for gapic-generator-java"
130152
runs-on: ubuntu-22.04
131153
steps:
@@ -172,6 +194,8 @@ jobs:
172194
GOOGLE_SDK_JAVA_LOGGING: true
173195

174196
build-java8-gapic-generator-java:
197+
needs: filter
198+
if: ${{ needs.filter.outputs.library == 'true' }}
175199
name: "build(8) for gapic-generator-java"
176200
runs-on: ubuntu-22.04
177201
steps:
@@ -219,6 +243,8 @@ jobs:
219243
popd
220244
221245
lint:
246+
needs: filter
247+
if: ${{ needs.filter.outputs.library == 'true' }}
222248
runs-on: ubuntu-22.04
223249
steps:
224250
- uses: actions/checkout@v4
@@ -233,6 +259,8 @@ jobs:
233259
run: mvn -B -ntp fmt:check
234260

235261
compatibility:
262+
needs: filter
263+
if: ${{ needs.filter.outputs.library == 'true' }}
236264
runs-on: ubuntu-22.04
237265
steps:
238266
- uses: actions/checkout@v4
@@ -248,6 +276,8 @@ jobs:
248276
run: mvn package clirr:check -DskipTests -Dfmt.skip
249277

250278
build-java8-showcase:
279+
needs: filter
280+
if: ${{ needs.filter.outputs.library == 'true' }}
251281
name: "build(8) for showcase"
252282
runs-on: ubuntu-22.04
253283
steps:
@@ -318,6 +348,8 @@ jobs:
318348
--batch-mode \
319349
--no-transfer-progress
320350
showcase:
351+
needs: filter
352+
if: ${{ needs.filter.outputs.library == 'true' }}
321353
runs-on: ubuntu-22.04
322354
strategy:
323355
matrix:
@@ -394,6 +426,8 @@ jobs:
394426
--no-transfer-progress
395427
396428
showcase-clirr:
429+
needs: filter
430+
if: ${{ needs.filter.outputs.library == 'true' }}
397431
if: ${{ github.base_ref != '' }} # Only execute on pull_request trigger event
398432
runs-on: ubuntu-22.04
399433
steps:
@@ -425,6 +459,8 @@ jobs:
425459
mvn clirr:check -B -ntp -DcomparisonVersion=$SHOWCASE_CLIENT_VERSION
426460
427461
gapic-generator-java-bom:
462+
needs: filter
463+
if: ${{ needs.filter.outputs.library == 'true' }}
428464
runs-on: ubuntu-22.04
429465
steps:
430466
- uses: actions/checkout@v4
@@ -442,6 +478,8 @@ jobs:
442478
bom-path: gapic-generator-java-bom/pom.xml
443479

444480
unmanaged_dependency_check:
481+
needs: filter
482+
if: ${{ needs.filter.outputs.library == 'true' }}
445483
runs-on: ubuntu-22.04
446484
steps:
447485
- uses: actions/checkout@v4
@@ -465,6 +503,8 @@ jobs:
465503
bom-path: gapic-generator-java-bom/pom.xml
466504

467505
dependency_analyzer_unit_test:
506+
needs: filter
507+
if: ${{ needs.filter.outputs.library == 'true' }}
468508
runs-on: ubuntu-22.04
469509
steps:
470510
- uses: actions/checkout@v4

sdk-platform-java/.github/workflows/create_additional_release_tag.yaml renamed to .github/workflows/sdk-platform-java-create_additional_release_tag.yaml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,28 @@
1-
name: Create additional tags for each release
1+
name: sdk-platform-java Create additional tags for each release
22

33
on:
44
release:
55
types: [published]
66
workflow_dispatch:
77

8+
env:
9+
BUILD_SUBDIR: sdk-platform-java
810
jobs:
11+
filter:
12+
runs-on: ubuntu-latest
13+
outputs:
14+
library: ${{ steps.filter.outputs.library }}
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: dorny/paths-filter@v3
18+
id: filter
19+
with:
20+
filters: |
21+
library:
22+
- 'sdk-platform-java/**'
923
build:
24+
needs: filter
25+
if: ${{ needs.filter.outputs.library == 'true' }}
1026
runs-on: ubuntu-latest
1127
permissions:
1228
# Permission to create tag

sdk-platform-java/.github/workflows/dependency_compatibility_test.yaml renamed to .github/workflows/sdk-platform-java-dependency_compatibility_test.yaml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Dependency Compatibility Test
1+
name: sdk-platform-java Dependency Compatibility Test
22

33
on:
44
pull_request:
@@ -14,8 +14,24 @@ on:
1414
required: false
1515
default: ''
1616

17+
env:
18+
BUILD_SUBDIR: sdk-platform-java
1719
jobs:
20+
filter:
21+
runs-on: ubuntu-latest
22+
outputs:
23+
library: ${{ steps.filter.outputs.library }}
24+
steps:
25+
- uses: actions/checkout@v4
26+
- uses: dorny/paths-filter@v3
27+
id: filter
28+
with:
29+
filters: |
30+
library:
31+
- 'sdk-platform-java/**'
1832
dependency-compatibility-test:
33+
needs: filter
34+
if: ${{ needs.filter.outputs.library == 'true' }}
1935
runs-on: ubuntu-latest
2036
permissions:
2137
contents: read

sdk-platform-java/.github/workflows/downstream.yaml renamed to .github/workflows/sdk-platform-java-downstream.yaml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,25 @@ on:
77
- showcase/**
88
- test/**
99

10-
name: Downstream Check
10+
name: sdk-platform-java Downstream Check
11+
env:
12+
BUILD_SUBDIR: sdk-platform-java
1113
jobs:
14+
filter:
15+
runs-on: ubuntu-latest
16+
outputs:
17+
library: ${{ steps.filter.outputs.library }}
18+
steps:
19+
- uses: actions/checkout@v4
20+
- uses: dorny/paths-filter@v3
21+
id: filter
22+
with:
23+
filters: |
24+
library:
25+
- 'sdk-platform-java/**'
1226
downstream-compatibility:
27+
needs: filter
28+
if: ${{ needs.filter.outputs.library == 'true' }}
1329
runs-on: ubuntu-22.04
1430
strategy:
1531
fail-fast: false
@@ -41,6 +57,8 @@ jobs:
4157
- name: Perform downstream compatibility testing
4258
run: REPOS_UNDER_TEST="${{ matrix.repo }}" ./.kokoro/presubmit/downstream-compatibility.sh
4359
downstream-compatibility-spring-generator:
60+
needs: filter
61+
if: ${{ needs.filter.outputs.library == 'true' }}
4462
runs-on: ubuntu-22.04
4563
strategy:
4664
fail-fast: false

sdk-platform-java/.github/workflows/downstream_protobuf_compatibility_check_nightly.yaml renamed to .github/workflows/sdk-platform-java-downstream_protobuf_compatibility_check_nightly.yaml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,25 @@ on:
1212
schedule:
1313
- cron: '0 1 * * *' # Nightly at 1am
1414

15-
name: Downstream Protobuf Compatibility Check Nightly
15+
name: sdk-platform-java Downstream Protobuf Compatibility Check Nightly
16+
env:
17+
BUILD_SUBDIR: sdk-platform-java
1618
jobs:
19+
filter:
20+
runs-on: ubuntu-latest
21+
outputs:
22+
library: ${{ steps.filter.outputs.library }}
23+
steps:
24+
- uses: actions/checkout@v4
25+
- uses: dorny/paths-filter@v3
26+
id: filter
27+
with:
28+
filters: |
29+
library:
30+
- 'sdk-platform-java/**'
1731
downstream-protobuf-test:
32+
needs: filter
33+
if: ${{ needs.filter.outputs.library == 'true' }}
1834
# This job runs if any of the three conditions match:
1935
# 1. PR is raised from Release-Please (PR comes from branch: release-please--branches-main)
2036
# 2. Job is invoked by the nightly job (scheduled event)

sdk-platform-java/.github/workflows/downstream_unmanaged_dependency_check.yaml renamed to .github/workflows/sdk-platform-java-downstream_unmanaged_dependency_check.yaml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,25 @@ on:
77
- .github/workflows/downstream_unmanaged_dependency_check.yaml
88
- java-shared-dependencies/**
99

10-
name: Downstream Unmanaged Dependency Check
10+
name: sdk-platform-java Downstream Unmanaged Dependency Check
11+
env:
12+
BUILD_SUBDIR: sdk-platform-java
1113
jobs:
14+
filter:
15+
runs-on: ubuntu-latest
16+
outputs:
17+
library: ${{ steps.filter.outputs.library }}
18+
steps:
19+
- uses: actions/checkout@v4
20+
- uses: dorny/paths-filter@v3
21+
id: filter
22+
with:
23+
filters: |
24+
library:
25+
- 'sdk-platform-java/**'
1226
validate:
27+
needs: filter
28+
if: ${{ needs.filter.outputs.library == 'true' }}
1329
runs-on: ubuntu-22.04
1430
strategy:
1531
fail-fast: false

sdk-platform-java/.github/workflows/java_compatibility_check.yaml renamed to .github/workflows/sdk-platform-java-java_compatibility_check.yaml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,25 @@
1515
# downstream client libraries before they are released.
1616
on:
1717
pull_request:
18-
name: Java 8 compatibility check
18+
name: sdk-platform-java Java 8 compatibility check
19+
env:
20+
BUILD_SUBDIR: sdk-platform-java
1921
jobs:
22+
filter:
23+
runs-on: ubuntu-latest
24+
outputs:
25+
library: ${{ steps.filter.outputs.library }}
26+
steps:
27+
- uses: actions/checkout@v4
28+
- uses: dorny/paths-filter@v3
29+
id: filter
30+
with:
31+
filters: |
32+
library:
33+
- 'sdk-platform-java/**'
2034
java8-compatibility-check:
35+
needs: filter
36+
if: ${{ needs.filter.outputs.library == 'true' }}
2137
runs-on: ubuntu-latest
2238
steps:
2339
- uses: actions/checkout@v4
@@ -43,4 +59,4 @@ jobs:
4359
exit 1
4460
fi
4561
done
46-
echo "All class files are compatible with Java 8."
62+
echo "All class files are compatible with Java 8."

sdk-platform-java/.github/workflows/nightly.yaml renamed to .github/workflows/sdk-platform-java-nightly.yaml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,29 @@
1-
name: Nightly
1+
name: sdk-platform-java Nightly
22
on:
33
workflow_dispatch:
44
schedule:
55
- cron: '0 1 * * *' # Nightly at 1am
66
defaults:
77
run:
88
shell: bash
9+
env:
10+
BUILD_SUBDIR: sdk-platform-java
911
jobs:
12+
filter:
13+
runs-on: ubuntu-latest
14+
outputs:
15+
library: ${{ steps.filter.outputs.library }}
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: dorny/paths-filter@v3
19+
id: filter
20+
with:
21+
filters: |
22+
library:
23+
- 'sdk-platform-java/**'
1024
nightly:
25+
needs: filter
26+
if: ${{ needs.filter.outputs.library == 'true' }}
1127
strategy:
1228
fail-fast: false
1329
matrix:
@@ -34,6 +50,8 @@ jobs:
3450
--title "Nightly build for Java ${{ matrix.java }} on ${{ matrix.os }} failed." \
3551
--body "The build has failed : https://github.com/googleapis/gapic-generator-java/actions/runs/${GITHUB_RUN_ID}"
3652
nightly-java8: # Compile with JDK 11. Run tests with JDK 8.
53+
needs: filter
54+
if: ${{ needs.filter.outputs.library == 'true' }}
3755
strategy:
3856
fail-fast: false
3957
matrix:

0 commit comments

Comments
 (0)