Skip to content

Commit 92fcecc

Browse files
authored
ci: adding flatten plugin check (#530)
Fixes #525
1 parent c48b878 commit 92fcecc

3 files changed

Lines changed: 71 additions & 1 deletion

File tree

.github/workflows/downstream-dependencies.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,19 @@ jobs:
2727
- run: sudo apt-get update -y
2828
- run: sudo apt-get install libxml2-utils
2929
- run: .kokoro/client-library-check.sh ${{matrix.repo}} dependencies
30+
31+
flatten-plugin-check:
32+
runs-on: ubuntu-latest
33+
steps:
34+
- uses: actions/checkout@v3
35+
- uses: actions/setup-java@v3
36+
with:
37+
distribution: zulu
38+
java-version: 11
39+
- run: java -version
40+
- run: sudo apt-get update -y
41+
- run: sudo apt-get install libxml2-utils
42+
- run: .kokoro/client-library-check.sh java-storage flatten-plugin
43+
env:
44+
REPO_TAG: v2.9.3
45+
EXPECTED_DEPENDENCIES_LIST: java-storage-v2.9.3-expected-flattened-dependencies.txt

.kokoro/client-library-check.sh

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,12 @@ echo "Version: ${VERSION}"
5252

5353
# Check this BOM against a few java client libraries
5454
# java-bigquery
55-
git clone "https://github.com/googleapis/${REPO}.git" --depth=1
55+
if [ -z "${REPO_TAG}" ]; then
56+
git clone "https://github.com/googleapis/${REPO}.git" --depth=1
57+
else
58+
git clone "https://github.com/googleapis/${REPO}.git" --depth=1 --branch "${REPO_TAG}"
59+
fi
60+
5661
pushd ${REPO}
5762

5863
# replace version
@@ -69,6 +74,22 @@ dependencies)
6974
.kokoro/dependencies.sh
7075
RETURN_CODE=$?
7176
;;
77+
flatten-plugin)
78+
# This creates .flattened-pom.xml
79+
.kokoro/build.sh
80+
pushd google-cloud-*
81+
mvn dependency:list -f .flattened-pom.xml -DincludeScope=runtime -Dsort=true \
82+
| grep '\[INFO] .*:.*:.*:.*:.*' |awk '{print $2}' > .actual-flattened-dependencies-list.txt
83+
echo "Diff from the expected file (${EXPECTED_DEPENDENCIES_LIST}):"
84+
diff "${scriptDir}/${EXPECTED_DEPENDENCIES_LIST}" .actual-flattened-dependencies-list.txt
85+
RETURN_CODE=$?
86+
if [ "${RETURN_CODE}" == 0 ]; then
87+
echo "No diff."
88+
else
89+
echo "There was a diff."
90+
fi
91+
popd
92+
;;
7293
*)
7394
# This reads the JOB_TYPE environmental variable
7495
.kokoro/build.sh
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
com.fasterxml.jackson.core:jackson-core:jar:2.13.3:compile
2+
com.google.api-client:google-api-client:jar:1.35.1:compile
3+
com.google.api.grpc:proto-google-common-protos:jar:2.9.0:compile
4+
com.google.api.grpc:proto-google-iam-v1:jar:1.4.1:compile
5+
com.google.api:api-common:jar:2.2.1:compile
6+
com.google.api:gax-httpjson:jar:0.103.2:compile
7+
com.google.api:gax:jar:2.18.2:compile
8+
com.google.apis:google-api-services-storage:jar:v1-rev20220705-1.32.1:compile
9+
com.google.auth:google-auth-library-credentials:jar:1.7.0:compile
10+
com.google.auth:google-auth-library-oauth2-http:jar:1.7.0:compile
11+
com.google.auto.value:auto-value-annotations:jar:1.10:compile
12+
com.google.cloud:google-cloud-core-http:jar:2.8.0:compile
13+
com.google.cloud:google-cloud-core:jar:2.8.0:compile
14+
com.google.code.findbugs:jsr305:jar:3.0.2:compile
15+
com.google.code.gson:gson:jar:2.9.0:compile
16+
com.google.guava:failureaccess:jar:1.0.1:compile
17+
com.google.guava:guava:jar:31.1-jre:compile
18+
com.google.guava:listenablefuture:jar:9999.0-empty-to-avoid-conflict-with-guava:compile
19+
com.google.http-client:google-http-client-apache-v2:jar:1.42.0:compile
20+
com.google.http-client:google-http-client-appengine:jar:1.42.0:compile
21+
com.google.http-client:google-http-client-gson:jar:1.42.0:compile
22+
com.google.http-client:google-http-client-jackson2:jar:1.42.0:compile
23+
com.google.http-client:google-http-client:jar:1.42.0:compile
24+
com.google.j2objc:j2objc-annotations:jar:1.3:compile
25+
com.google.oauth-client:google-oauth-client:jar:1.34.1:compile
26+
com.google.protobuf:protobuf-java-util:jar:3.21.1:compile
27+
com.google.protobuf:protobuf-java:jar:3.21.1:compile
28+
io.grpc:grpc-context:jar:1.47.0:compile
29+
io.opencensus:opencensus-api:jar:0.31.1:compile
30+
io.opencensus:opencensus-contrib-http-util:jar:0.31.1:compile
31+
javax.annotation:javax.annotation-api:jar:1.3.2:compile
32+
org.checkerframework:checker-qual:jar:3.22.2:compile
33+
org.threeten:threetenbp:jar:1.6.0:compile

0 commit comments

Comments
 (0)