Skip to content
This repository was archived by the owner on Dec 3, 2023. It is now read-only.

Commit 633cbfa

Browse files
authored
chore: downstream check for all libraries in single job (#713)
* chore: downstream check for all libraries in single job * chore: give permission to run script * Update downstream-client-library-check.sh * Update downstream-client-library-check.sh * Update downstream-client-library-check.sh * Update downstream-client-library-check.sh
1 parent 6fbee93 commit 633cbfa

File tree

2 files changed

+258
-0
lines changed

2 files changed

+258
-0
lines changed

.github/workflows/downstream.yaml

Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
# Copyright 2022 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
# Github action job to test core java library features on
15+
# downstream client libraries before they are released.
16+
on:
17+
pull_request:
18+
types: [ labeled ]
19+
branches:
20+
- main
21+
name: downstream
22+
jobs:
23+
dependencies:
24+
if: ${{ github.event.label.name == 'downstream-check:run' }}
25+
runs-on: ubuntu-latest
26+
strategy:
27+
fail-fast: false
28+
matrix:
29+
java: [17]
30+
repo:
31+
# This list needs to be updated manually until an automated solution is in place.
32+
- accessapproval
33+
- accesscontextmanager
34+
- aiplatform
35+
- analytics-admin
36+
- analytics-data
37+
- api-gateway
38+
- apigee-connect
39+
- appengine-admin
40+
- area120-tables
41+
- artifact-registry
42+
- asset
43+
- assured-workloads
44+
- automl
45+
- bigquery
46+
- bigqueryconnection
47+
- bigquerydatatransfer
48+
- bigquerymigration
49+
- bigqueryreservation
50+
- bigtable
51+
- billing
52+
- billingbudgets
53+
- binary-authorization
54+
- channel
55+
- cloudbuild
56+
- compute
57+
- contact-center-insights
58+
- container
59+
- containeranalysis
60+
- data-fusion
61+
- datacatalog
62+
- dataflow
63+
- datalabeling
64+
- dataproc
65+
- dataproc-metastore
66+
- datastore
67+
- datastream
68+
- debugger-client
69+
- deploy
70+
- dialogflow
71+
- dialogflow-cx
72+
- dlp
73+
- dms
74+
- dns
75+
- document-ai
76+
- domains
77+
- errorreporting
78+
- essential-contacts
79+
- eventarc
80+
- filestore
81+
- firestore
82+
- functions
83+
- game-servers
84+
- gke-connect-gateway
85+
- gkehub
86+
- gsuite-addons
87+
- iam-admin
88+
- iamcredentials
89+
- iot
90+
- kms
91+
- language
92+
- life-sciences
93+
- logging
94+
- logging-logback
95+
- managed-identities
96+
- mediatranslation
97+
- memcache
98+
- monitoring
99+
- monitoring-dashboards
100+
- network-management
101+
- network-security
102+
- networkconnectivity
103+
- notebooks
104+
- orchestration-airflow
105+
- orgpolicy
106+
- os-config
107+
- os-login
108+
- phishingprotection
109+
- policy-troubleshooter
110+
- private-catalog
111+
- profiler
112+
- pubsublite
113+
- recaptchaenterprise
114+
- recommendations-ai
115+
- recommender
116+
- redis
117+
- resource-settings
118+
- resourcemanager
119+
- retail
120+
- scheduler
121+
- secretmanager
122+
- security-private-ca
123+
- securitycenter
124+
- securitycenter-settings
125+
- service-control
126+
- service-management
127+
- service-usage
128+
- servicedirectory
129+
- shell
130+
- spanner
131+
- spanner-jdbc
132+
- speech
133+
- storage
134+
- storage-nio
135+
- storage-transfer
136+
- talent
137+
- tasks
138+
- texttospeech
139+
- tpu
140+
- trace
141+
- translate
142+
- video-intelligence
143+
- video-transcoder
144+
- vision
145+
- vpcaccess
146+
- webrisk
147+
- websecurityscanner
148+
- workflow-executions
149+
- workflows
150+
steps:
151+
- uses: actions/checkout@v2
152+
- uses: actions/setup-java@v1
153+
with:
154+
java-version: ${{matrix.java}}
155+
- run: java -version
156+
- run: sudo apt-get install libxml2-utils
157+
- run: .kokoro/downstream-client-library-check.sh google-cloud-core-bom ${{matrix.repo}}
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
#!/bin/bash
2+
# Copyright 2022 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
set -eo pipefail
17+
# Display commands being run.
18+
set -x
19+
20+
CORE_LIBRARY_ARTIFACT=$1
21+
CLIENT_LIBRARY=$2
22+
## Get the directory of the build script
23+
scriptDir="$(realpath "$(dirname "${BASH_SOURCE[0]}")")"
24+
## cd to the parent directory, i.e. the root of the git repo
25+
cd "${scriptDir}"/..
26+
27+
# Make java core library artifacts available for 'mvn install' at the bottom
28+
mvn verify install -B -V -ntp -fae \
29+
-DskipTests=true \
30+
-Dmaven.javadoc.skip=true \
31+
-Dgcloud.download.skip=true \
32+
-Denforcer.skip=true
33+
34+
# Namespace (xmlns) prevents xmllint from specifying tag names in XPath
35+
CORE_VERSION=$(sed -e 's/xmlns=".*"//' pom.xml | xmllint --xpath '/project/version/text()' -)
36+
37+
if [ -z "${CORE_VERSION}" ]; then
38+
echo "Version is not found in ${CORE_VERSION_POM}"
39+
exit 1
40+
fi
41+
echo "Version: ${CORE_VERSION}"
42+
43+
# Round 1
44+
# Check this java core library against HEAD of java-shared dependencies
45+
46+
git clone "https://github.com/googleapis/java-shared-dependencies.git" --depth=1
47+
pushd java-shared-dependencies/first-party-dependencies
48+
49+
# replace version
50+
xmllint --shell pom.xml << EOF
51+
setns x=http://maven.apache.org/POM/4.0.0
52+
cd .//x:artifactId[text()="${CORE_LIBRARY_ARTIFACT}"]
53+
cd ../x:version
54+
set ${CORE_VERSION}
55+
save pom.xml
56+
EOF
57+
58+
# run dependencies script
59+
cd ..
60+
61+
mvn verify install -B -V -ntp -fae \
62+
-DskipTests=true \
63+
-Dmaven.javadoc.skip=true \
64+
-Dgcloud.download.skip=true \
65+
-Denforcer.skip=true
66+
67+
# Namespace (xmlns) prevents xmllint from specifying tag names in XPath
68+
SHARED_DEPS_VERSION=$(sed -e 's/xmlns=".*"//' pom.xml | xmllint --xpath '/project/version/text()' -)
69+
70+
if [ -z "${SHARED_DEPS_VERSION}" ]; then
71+
echo "Version is not found in ${SHARED_DEPS_VERSION_POM}"
72+
exit 1
73+
fi
74+
75+
# Round 2
76+
77+
# Check this BOM against java client libraries
78+
git clone "https://github.com/googleapis/java-${CLIENT_LIBRARY}.git" --depth=1
79+
pushd java-"${CLIENT_LIBRARY}"
80+
81+
if [[ $CLIENT_LIBRARY == "bigtable" ]]; then
82+
pushd google-cloud-bigtable-deps-bom
83+
fi
84+
85+
# replace version
86+
xmllint --shell pom.xml << EOF
87+
setns x=http://maven.apache.org/POM/4.0.0
88+
cd .//x:artifactId[text()="google-cloud-shared-dependencies"]
89+
cd ../x:version
90+
set ${SHARED_DEPS_VERSION}
91+
save pom.xml
92+
EOF
93+
94+
if [[ $CLIENT_LIBRARY == "bigtable" ]]; then
95+
popd
96+
fi
97+
98+
mvn verify install -B -V -ntp -fae \
99+
-Dmaven.javadoc.skip=true \
100+
-Dgcloud.download.skip=true \
101+
-Denforcer.skip=true

0 commit comments

Comments
 (0)