Add storage-provisioner check for gce during cleanup (#2431) #71
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: CI | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
workflow_dispatch: | |
inputs: | |
gradleArgs: | |
description: 'Gradle args: use this to limit tests e.g. test --tests "..."' | |
required: true | |
default: 'check' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Gradle cache | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
- name: Setup Java 8 | |
id: setup-java-8 | |
uses: actions/setup-java@v2 | |
with: | |
java-version: 8 | |
distribution: adopt | |
- name: Setup Java | |
id: setup-java | |
uses: actions/setup-java@v2 | |
with: | |
java-version: 17 | |
distribution: temurin | |
- name: Setup Python | |
uses: actions/[email protected] | |
with: | |
python-version: 3.7.x | |
- name: Install poetry | |
run: | | |
python3 -m pip install --upgrade pip | |
python3 -m pip install poetry | |
- name: Create gradle.properties | |
run: | | |
cat > gradle.properties <<EOF | |
# Adjust JVM memory usage to avoid "Expiring Daemon due to JVM Metaspace space being exhausted"; | |
# see https://docs.gradle.org/current/userguide/build_environment.html#sec:configuring_jvm_memory | |
org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -XX:+UseParallelGC | |
EOF | |
- id: getGradleArgs | |
run: | | |
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then | |
echo '::set-output name=args::${{ github.event.inputs.gradleArgs }}' | |
else | |
echo '::set-output name=args::check' | |
fi | |
- name: Gradle | |
env: | |
JAVA_HOME: ${{ steps.setup-java.outputs.path }} | |
JAVA8_HOME: ${{ steps.setup-java-8.outputs.path }} | |
UNIT_TEST_GOOGLE_SERVICE_ACCOUNT_JSON_BASE64: ${{secrets.UNIT_TEST_GOOGLE_SERVICE_ACCOUNT_JSON_BASE64}} | |
# For CI we generate a false gitDescribe: this is expected to be the output of `git describe --tags`, | |
# but because we're running in a shallow checkout, we synthesize a value | |
run: ./gradlew | |
--no-daemon | |
--parallel | |
--build-cache | |
-PtestIgnoreFailures=true | |
-PgithubRepo=$GITHUB_REPOSITORY | |
-PgitDescribe=fallout-0.0.0-0-g$GITHUB_SHA | |
${{ steps.getGradleArgs.outputs.args }} | |
- name: Archive JUnit XML Artifacts | |
if: always() | |
uses: actions/upload-artifact@v2 | |
with: | |
# Artifact name | |
name: junit-xml | |
# A file, directory or wildcard pattern that describes what to upload | |
path: | | |
**/build/reports/junit/**/*.xml |