Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Java 8 unit test to build code in Java 17 and run tests on Java 8 (#1800) #2770

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/.OwlBot.lock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
# limitations under the License.
docker:
image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest
digest: sha256:af2eda87a54601ae7b7b2be5055c17b43ac98a7805b586772db314de8a7d4a1d
# created: 2023-06-16T02:10:09.149325782Z
digest: sha256:32851debfefed2b66038e0141f1b5c2103bb59ba80b7475adbc10ef7abab3de7
# created: 2023-06-22T15:06:52.039318836Z
6 changes: 4 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ updates:
interval: "daily"
# Disable version updates for Maven dependencies
# we use renovate-bot as well as shared-dependencies BOM to update maven dependencies.
ignore: "*"
ignore:
- dependency-name: "*"
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "daily"
# Disable version updates for pip dependencies
# If a security vulnerability comes in, we will be notified about
# it via template in the synthtool repository.
ignore: "*"
ignore:
- dependency-name: "*"
3 changes: 1 addition & 2 deletions .github/sync-repo-settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ branchProtectionRules:
requiresCodeOwnerReviews: true
requiresStrictStatusChecks: false
requiredStatusCheckContexts:
- dependencies (8)
- dependencies (11)
- dependencies (17)
- lint
- clirr
- units (8)
Expand Down
26 changes: 24 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
strategy:
fail-fast: false
matrix:
java: [8, 11, 17]
java: [11, 17]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
Expand All @@ -36,6 +36,28 @@ jobs:
- run: .kokoro/build.sh
env:
JOB_TYPE: test
units-java8:
# Building using Java 17 and run the tests with Java 8 runtime
name: "units (8)"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: 8
distribution: zulu
- name: "Set jvm system property environment variable for surefire plugin (unit tests)"
# Maven surefire plugin (unit tests) allows us to specify JVM to run the tests.
# https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#jvm
run: echo "SUREFIRE_JVM_OPT=-Djvm=${JAVA_HOME}/bin/java" >> $GITHUB_ENV
shell: bash
- uses: actions/setup-java@v3
with:
java-version: 17
distribution: zulu
- run: .kokoro/build.sh
env:
JOB_TYPE: test
windows:
runs-on: windows-latest
steps:
Expand All @@ -54,7 +76,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
java: [8, 11, 17]
java: [17]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
Expand Down
3 changes: 2 additions & 1 deletion .kokoro/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ set +e

case ${JOB_TYPE} in
test)
mvn test -B -ntp -Dclirr.skip=true -Denforcer.skip=true
echo "SUREFIRE_JVM_OPT: ${SUREFIRE_JVM_OPT}"
mvn test -B -ntp -Dclirr.skip=true -Denforcer.skip=true ${SUREFIRE_JVM_OPT}
RETURN_CODE=$?
;;
lint)
Expand Down
7 changes: 7 additions & 0 deletions google-cloud-bigquery/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,13 @@
<id>java17</id>
<activation>
<jdk>[17,)</jdk>
<property>
<!--
In Java 8 unit tests where we run tests in Java 8 after building
bytecode on Java 17, we don't want to add the argLine
-->
<name>!jvm</name>
</property>
</activation>
<build>
<plugins>
Expand Down