Skip to content

Commit eaf2389

Browse files
committed
chore: Install artifacts for binary
1 parent 2c5e527 commit eaf2389

File tree

3 files changed

+8
-36
lines changed

3 files changed

+8
-36
lines changed

.github/workflows/downstream_protobuf_compatibility_check_nightly.yaml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,25 +45,15 @@ jobs:
4545
steps:
4646
- name: Checkout sdk-platform-java repo
4747
uses: actions/checkout@v4
48-
- name: Checkout downstream handwritten repo
49-
uses: actions/checkout@v4
50-
with:
51-
repository: "googleapis/${{ matrix.repo }}"
52-
path: "${{ matrix.repo }}"
5348
- uses: actions/setup-java@v4
5449
with:
5550
# Use Java 11 for this as Linkage Checker is only compatible with Java 11 or below
5651
java-version: 11
5752
distribution: temurin
58-
- name: Install downstream repo locally
59-
run: |
60-
pushd "${{ matrix.repo }}"
61-
mvn -B -ntp install -T 1C -DskipTests -Dclirr.skip -Denforcer.skip
62-
popd
6353
- name: Print Protobuf-Java testing version
6454
run: echo "Testing with Protobuf-Java v${{ matrix.protobuf-version }}"
6555
- name: Perform downstream source compatibility testing
6656
run: REPOS_UNDER_TEST="${{ matrix.repo }}" PROTOBUF_RUNTIME_VERSION="${{ matrix.protobuf-version }}" ./.kokoro/nightly/downstream-protobuf-source-compatibility.sh
6757
- name: Perform downstream binary compatibility testing
68-
run: REPOS_UNDER_TEST="${{ matrix.repo }}" PROTOBUF_RUNTIME_VERSION="${{ matrix.protobuf-version }}" REPOS_INSTALLED_LOCALLY="true" ./.kokoro/nightly/downstream-protobuf-binary-compatibility.sh
58+
run: REPOS_UNDER_TEST="${{ matrix.repo }}" PROTOBUF_RUNTIME_VERSION="${{ matrix.protobuf-version }}" ./.kokoro/nightly/downstream-protobuf-binary-compatibility.sh
6959

.kokoro/nightly/downstream-protobuf-binary-compatibility.sh

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,6 @@
1515

1616
set -eo pipefail
1717

18-
# There are three Env Vars that this script uses.
19-
# 1. (Required) REPOS_UNDER_TEST: Comma separate list of the repo names
20-
# 2. (Required) PROTOBUF_RUNTIME_VERSION: Protobuf runtime version to test again
21-
# 3. REPOS_INSTALLED_LOCALLY: Flag (if set to "true) will determine if the repo
22-
# needs to be cloned from github and re-installed locally to the m2. If the artifact
23-
# is already installed locally, this saves time as the artifact is not again compiled
24-
# and built.
25-
2618
# Comma-delimited list of repos to test with the local java-shared-dependencies
2719
if [ -z "${REPOS_UNDER_TEST}" ]; then
2820
echo "REPOS_UNDER_TEST must be set to run downstream-protobuf-binary-compatibility.sh"
@@ -85,18 +77,11 @@ mvn -B -ntp clean compile -T 1C
8577
pushd dependencies
8678

8779
for repo in ${REPOS_UNDER_TEST//,/ }; do # Split on comma
88-
if [ "${REPOS_INSTALLED_LOCALLY}" != "true" ]; then
89-
# Perform testing on main (with latest changes). Shallow copy as history is not important
90-
git clone "https://github.com/googleapis/${repo}.git" --depth=1
91-
pushd "${repo}"
92-
# Install all repo modules to ~/.m2 (there can be multiple relevant artifacts to test i.e. core, admin, control)
93-
mvn -B -ntp install -T 1C -DskipTests -Dclirr.skip -Denforcer.skip
94-
else
95-
# If installed locally to .m2, then just pull the versions.txt file to parse
96-
mkdir -p "../../${repo}"
97-
pushd "../../${repo}"
98-
curl -Os "https://raw.githubusercontent.com/googleapis/${repo}/refs/heads/main/versions.txt"
99-
fi
80+
# Perform testing on main (with latest changes). Shallow copy as history is not important
81+
git clone "https://github.com/googleapis/${repo}.git" --depth=1
82+
pushd "${repo}"
83+
# Install all repo modules to ~/.m2 (there can be multiple relevant artifacts to test i.e. core, admin, control)
84+
mvn -B -ntp install -T 1C -DskipTests -Dclirr.skip -Denforcer.skip
10085

10186
artifact_list=""
10287
if [ "${repo}" == "google-cloud-java" ]; then
@@ -114,7 +99,7 @@ for repo in ${REPOS_UNDER_TEST//,/ }; do # Split on comma
11499
# The `-s` argument filters the linkage check problems that stem from the artifact
115100
program_args="-r --artifacts ${artifact_list},com.google.protobuf:protobuf-java:${PROTOBUF_RUNTIME_VERSION},com.google.protobuf:protobuf-java-util:${PROTOBUF_RUNTIME_VERSION} -s ${artifact_list}"
116101
echo "Linkage Checker Program Arguments: ${program_args}"
117-
mvn -B -ntp exec:java -Dexec.mainClass="com.google.cloud.tools.opensource.classpath.LinkageCheckerMain" -Dexec.args="${program_args}" -P exec-linkage-checker
102+
mvn -B -ntp exec:java -Dexec.args="${program_args}" -P exec-linkage-checker
118103
fi
119104
echo "done"
120105
done

.kokoro/nightly/downstream-protobuf-source-compatibility.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@
1515

1616
set -eo pipefail
1717

18-
# There are two Env Vars that this script uses.
19-
# 1. (Required) REPOS_UNDER_TEST: Comma separate list of the repo names
20-
# 2. (Required) PROTOBUF_RUNTIME_VERSION: Protobuf runtime version to test again
21-
2218
# Comma-delimited list of repos to test with the local java-shared-dependencies
2319
if [ -z "${REPOS_UNDER_TEST}" ]; then
2420
echo "REPOS_UNDER_TEST must be set to run downstream-protobuf-source-compatibility.sh"
@@ -46,4 +42,5 @@ for repo in ${REPOS_UNDER_TEST//,/ }; do # Split on comma
4642
-Dmaven.javadoc.skip=true \
4743
-Dprotobuf.version=${PROTOBUF_RUNTIME_VERSION} \
4844
-T 1C
45+
popd
4946
done

0 commit comments

Comments
 (0)