blob: ab4317f18a28a437161b9d5a40cc450b63bdb252 [file] [log] [blame]
name: 'build-single-playground-project'
description: 'Builds one playground project based on inputs'
inputs:
project:
description: "Name of the project (used for artifacts)"
required: true
project-root:
description: "Root folder of the project (used for building)"
required: true
gradle-cache-password:
description: "password for gradle cache"
gradle-enterprise-access-key:
description: "access key for gradle enterprise"
gradle-flags:
description: "flags to pass while invoking gradle"
runs:
using: "composite"
steps:
- name: "Setup JDK 8 for tools.jar"
id: setup-java8
uses: actions/setup-java@v1
with:
java-version: "8"
- name: "set tools jar path"
id: setup-tools-jar
shell: bash
run: |
set -x
TOOLS_JAR=$JAVA_HOME/lib/tools.jar
echo "::set-output name=toolsJar::$TOOLS_JAR"
- name: "Setup JDK 17"
id: setup-java
uses: actions/setup-java@v1
with:
java-version: "17"
# TODO b/216535050: Implement task to install the exact AndroidX ndk
# version in case it is not available.
- name: "Install Cmake"
shell: bash
run: echo "yes" | $ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager --install "cmake;3.22.1"
- name: "Set environment variables"
shell: bash
run: |
set -x
echo "DIST_DIR=$HOME/dist" >> $GITHUB_ENV
- name: "Setup Gradle"
uses: gradle/gradle-build-action@v2
with:
# Only save Gradle User Home state for builds on the 'androidx-main' branch.
# Builds on other branches will only read existing entries from the cache.
cache-read-only: ${{ github.ref != 'refs/heads/androidx-main' }}
# Don't reuse cache entries from any other Job.
gradle-home-cache-strict-match: true
# Limit the size of the cache entry.
# These directories contain instrumented/transformed dependency jars which can be reconstructed relatively quickly.
gradle-home-cache-excludes: |
caches/jars-9
caches/transforms-3
- name: "gradle buildOnServer zipTestConfigsWithApks test"
env:
JAVA_HOME: ${{ steps.setup-java.outputs.path }}
JAVA_TOOLS_JAR: ${{ steps.setup-tools-jar.outputs.toolsJar }}
GRADLE_BUILD_CACHE_PASSWORD: ${{ inputs.gradle-cache-password }}
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ inputs.gradle-enterprise-access-key }}
working-directory: ${{ inputs.project-root }}
shell: bash
run: ./gradlew buildOnServer zipTestConfigsWithApks test ${{ inputs.gradle-flags }}