From 92d217cb3a51334eb670c9d533af642b333a81db Mon Sep 17 00:00:00 2001 From: Mridula <66699525+mpeddada1@users.noreply.github.com> Date: Wed, 3 Aug 2022 11:14:16 -0400 Subject: [PATCH] ci: downstream check for native image tests (#771) --- .../workflows/downstream-native-image.yaml | 41 +++++++++++++++++++ .github/workflows/downstream.yaml | 2 +- .kokoro/downstream-client-library-check.sh | 9 ++-- 3 files changed, 47 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/downstream-native-image.yaml diff --git a/.github/workflows/downstream-native-image.yaml b/.github/workflows/downstream-native-image.yaml new file mode 100644 index 00000000..0439456a --- /dev/null +++ b/.github/workflows/downstream-native-image.yaml @@ -0,0 +1,41 @@ +on: + push: + branches: + - main + pull_request: + +# Keeping this file separate as the dependencies check would use more +# repositories than needed this downstream check for GraalVM native image +# compilation. +name: downstream +jobs: + # GraalVM job ensures the compatibility of GraaVM version + graalvm: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + graalvm: [22.1.0] + java: [11, 17] + repo: + # GAPIC library that doesn't use a real GCP project in integration tests + - orgpolicy + steps: + - uses: actions/checkout@v2 + - uses: stCarolas/setup-maven@v4 + with: + maven-version: 3.8.1 + - uses: ayltai/setup-graalvm@v1 + with: + java-version: ${{matrix.java}} + # When a new version of native-maven-plugin fails to run in a downstream + # library, it's likely to be an incompatibility with the GraalVM version. + # In that case, you need to upgrade the Docker container used in the + # tests in the downstream repositories (not just this value below). + # Example: https://github.com/googleapis/testing-infra-docker/pull/195 + graalvm-version: ${{matrix.graalvm}} + native-image: true + - run: java -version + - run: sudo apt-get update -y + - run: sudo apt-get install libxml2-utils + - run: .kokoro/downstream-client-library-check.sh ${{matrix.repo}} graalvm \ No newline at end of file diff --git a/.github/workflows/downstream.yaml b/.github/workflows/downstream.yaml index 4b3d0022..000fa0d5 100644 --- a/.github/workflows/downstream.yaml +++ b/.github/workflows/downstream.yaml @@ -156,4 +156,4 @@ jobs: - run: java -version - run: sudo apt-get update -y - run: sudo apt-get install libxml2-utils - - run: .kokoro/downstream-client-library-check.sh ${{matrix.repo}} + - run: .kokoro/downstream-client-library-check.sh ${{matrix.repo}} test diff --git a/.kokoro/downstream-client-library-check.sh b/.kokoro/downstream-client-library-check.sh index b17b020b..49574cee 100755 --- a/.kokoro/downstream-client-library-check.sh +++ b/.kokoro/downstream-client-library-check.sh @@ -18,6 +18,9 @@ set -eo pipefail set -x CLIENT_LIBRARY=$1 + +# Example JOB_TYPE: "test" or "graalvm" +export JOB_TYPE=$2 ## Get the directory of the build script scriptDir="$(realpath "$(dirname "${BASH_SOURCE[0]}")")" ## cd to the parent directory, i.e. the root of the git repo @@ -59,7 +62,5 @@ if [[ $CLIENT_LIBRARY == "bigtable" ]]; then popd fi -mvn verify install -B -V -ntp -fae \ --Dmaven.javadoc.skip=true \ --Dgcloud.download.skip=true \ --Denforcer.skip=true +# This reads the JOB_TYPE environmental variable ("test" or "graalvm") +.kokoro/build.sh