ci: use AOSS repository #395
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Unit Tests | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
unit-tests: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
java: [8, 11, 17, 21] | |
env: | |
CLOUDSDK_CORE_DISABLE_USAGE_REPORTING: true | |
CLOUDSDK_CORE_DISABLE_PROMPTS: true | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
java-version: ${{ matrix.java }} | |
distribution: temurin | |
- uses: google-github-actions/[email protected] | |
- uses: actions/cache@v3 | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-maven- | |
- name: Run tests | |
run: | | |
# google-github-actions/[email protected] sets up gcloud at, e.g,. | |
# "/opt/hostedtoolcache/gcloud/325.0.0/x64". appengine-plugins-core | |
# fails to find it, since the directory doesn't end with | |
# "google-cloud-sdk". Instead, appengine-plugins-core picks up the SDK | |
# at "/usr/lib/google-cloud-sdk" managed by a package manager. As a | |
# workaround, create a symlink at $HOME and add it to $PATH. | |
ln -s "$( dirname "$( dirname "$( which gcloud )")")" \ | |
"${HOME}"/google-cloud-sdk | |
ls -ld "${HOME}"/google-cloud-sdk | |
export PATH="${HOME}/google-cloud-sdk/bin:${PATH}" | |
gcloud components install app-engine-java --quiet | |
./mvnw -B -U --fail-at-end -DskipITs clean install -Dorg.slf4j.simpleLogger.showDateTime=true -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss:SSS |