Skip to content

Commit

Permalink
ci: adding flatten plugin check (#530)
Browse files Browse the repository at this point in the history
Fixes #525
  • Loading branch information
suztomo committed Oct 24, 2022
1 parent c48b878 commit 92fcecc
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 1 deletion.
16 changes: 16 additions & 0 deletions .github/workflows/downstream-dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,19 @@ jobs:
- run: sudo apt-get update -y
- run: sudo apt-get install libxml2-utils
- run: .kokoro/client-library-check.sh ${{matrix.repo}} dependencies

flatten-plugin-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 11
- run: java -version
- run: sudo apt-get update -y
- run: sudo apt-get install libxml2-utils
- run: .kokoro/client-library-check.sh java-storage flatten-plugin
env:
REPO_TAG: v2.9.3
EXPECTED_DEPENDENCIES_LIST: java-storage-v2.9.3-expected-flattened-dependencies.txt
23 changes: 22 additions & 1 deletion .kokoro/client-library-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,12 @@ echo "Version: ${VERSION}"
# Check this BOM against a few java client libraries
# java-bigquery
git clone "https://github.com/googleapis/${REPO}.git" --depth=1
if [ -z "${REPO_TAG}" ]; then
git clone "https://github.com/googleapis/${REPO}.git" --depth=1
else
git clone "https://github.com/googleapis/${REPO}.git" --depth=1 --branch "${REPO_TAG}"
fi

pushd ${REPO}

# replace version
Expand All @@ -69,6 +74,22 @@ dependencies)
.kokoro/dependencies.sh
RETURN_CODE=$?
;;
flatten-plugin)
# This creates .flattened-pom.xml
.kokoro/build.sh
pushd google-cloud-*
mvn dependency:list -f .flattened-pom.xml -DincludeScope=runtime -Dsort=true \
| grep '\[INFO] .*:.*:.*:.*:.*' |awk '{print $2}' > .actual-flattened-dependencies-list.txt
echo "Diff from the expected file (${EXPECTED_DEPENDENCIES_LIST}):"
diff "${scriptDir}/${EXPECTED_DEPENDENCIES_LIST}" .actual-flattened-dependencies-list.txt
RETURN_CODE=$?
if [ "${RETURN_CODE}" == 0 ]; then
echo "No diff."
else
echo "There was a diff."
fi
popd
;;
*)
# This reads the JOB_TYPE environmental variable
.kokoro/build.sh
Expand Down
33 changes: 33 additions & 0 deletions .kokoro/java-storage-v2.9.3-expected-flattened-dependencies.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
com.fasterxml.jackson.core:jackson-core:jar:2.13.3:compile
com.google.api-client:google-api-client:jar:1.35.1:compile
com.google.api.grpc:proto-google-common-protos:jar:2.9.0:compile
com.google.api.grpc:proto-google-iam-v1:jar:1.4.1:compile
com.google.api:api-common:jar:2.2.1:compile
com.google.api:gax-httpjson:jar:0.103.2:compile
com.google.api:gax:jar:2.18.2:compile
com.google.apis:google-api-services-storage:jar:v1-rev20220705-1.32.1:compile
com.google.auth:google-auth-library-credentials:jar:1.7.0:compile
com.google.auth:google-auth-library-oauth2-http:jar:1.7.0:compile
com.google.auto.value:auto-value-annotations:jar:1.10:compile
com.google.cloud:google-cloud-core-http:jar:2.8.0:compile
com.google.cloud:google-cloud-core:jar:2.8.0:compile
com.google.code.findbugs:jsr305:jar:3.0.2:compile
com.google.code.gson:gson:jar:2.9.0:compile
com.google.guava:failureaccess:jar:1.0.1:compile
com.google.guava:guava:jar:31.1-jre:compile
com.google.guava:listenablefuture:jar:9999.0-empty-to-avoid-conflict-with-guava:compile
com.google.http-client:google-http-client-apache-v2:jar:1.42.0:compile
com.google.http-client:google-http-client-appengine:jar:1.42.0:compile
com.google.http-client:google-http-client-gson:jar:1.42.0:compile
com.google.http-client:google-http-client-jackson2:jar:1.42.0:compile
com.google.http-client:google-http-client:jar:1.42.0:compile
com.google.j2objc:j2objc-annotations:jar:1.3:compile
com.google.oauth-client:google-oauth-client:jar:1.34.1:compile
com.google.protobuf:protobuf-java-util:jar:3.21.1:compile
com.google.protobuf:protobuf-java:jar:3.21.1:compile
io.grpc:grpc-context:jar:1.47.0:compile
io.opencensus:opencensus-api:jar:0.31.1:compile
io.opencensus:opencensus-contrib-http-util:jar:0.31.1:compile
javax.annotation:javax.annotation-api:jar:1.3.2:compile
org.checkerframework:checker-qual:jar:3.22.2:compile
org.threeten:threetenbp:jar:1.6.0:compile

0 comments on commit 92fcecc

Please sign in to comment.