matrix fixes #17
Workflow file for this run
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: Gradle Compatibility Check | |
on: [ push ] | |
jobs: | |
gradle-compatibility-builds: | |
name: ${{ matrix.sample-app }} build with AGP ${{ matrix.agp-version }} | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
sample-app_with_agp: | |
- "java_layout_current" | |
- "kotlin_compose_current" | |
- "java_layout_7" | |
- "kotlin_compose_7" | |
include: | |
- sample-app_with_agp-app: "java_layout_7" | |
sample-app: "java_layout" | |
cio-siteid-secret-key: "CUSTOMERIO_JAVA_WORKSPACE_SITE_ID" | |
cio-apikey-secret-key: "CUSTOMERIO_JAVA_WORKSPACE_API_KEY" | |
agp-version: "7.2.0" | |
gradle-plugin-version: "7.6.4" | |
jdk-version: "11" | |
java-version: "JavaVersion.VERSION_1_8" | |
kotlin-jvm-version: "1.8" | |
apk-scale-version: "0.1.4" | |
packaging-resources-action: "packagingOptions" | |
- sample-app_with_agp-app: "kotlin_compose_7" | |
sample-app: "kotlin_compose" | |
cio-siteid-secret-key: "CUSTOMERIO_KOTLIN_WORKSPACE_SITE_ID" | |
cio-apikey-secret-key: "CUSTOMERIO_KOTLIN_WORKSPACE_API_KEY" | |
agp-version: "7.2.0" | |
gradle-plugin-version: "7.6.4" | |
jdk-version: "11" | |
java-version: "JavaVersion.VERSION_1_8" | |
kotlin-jvm-version: "1.8" | |
apk-scale-version: "0.1.4" | |
packaging-resources-action: "packagingOptions" | |
- sample-app_with_agp-app: "java_layout_7" | |
sample-app: "java_layout" | |
cio-siteid-secret-key: "CUSTOMERIO_JAVA_WORKSPACE_SITE_ID" | |
cio-apikey-secret-key: "CUSTOMERIO_JAVA_WORKSPACE_API_KEY" | |
agp-version: "8.3.1" | |
jdk-version: "17" | |
# We don't need to specify further versions here, as we'll use the default values for actual gradle versions. | |
- sample-app_with_agp-app: "kotlin_compose_7" | |
sample-app: "kotlin_compose" | |
cio-siteid-secret-key: "CUSTOMERIO_KOTLIN_WORKSPACE_SITE_ID" | |
cio-apikey-secret-key: "CUSTOMERIO_KOTLIN_WORKSPACE_API_KEY" | |
agp-version: "8.3.1" | |
jdk-version: "17" | |
# We don't need to specify further versions here, as we'll use the default values for actual gradle versions. | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ matrix.gradle-version }}-${{ hashFiles('**/*.gradle*') }} | |
restore-keys: | | |
${{ runner.os }}-gradle-${{ matrix.gradle-version }}- | |
- name: Install Java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: "temurin" | |
java-version: ${{ matrix.jdk-version }} | |
- name: Install Android SDK | |
uses: android-actions/setup-android@v3 | |
- name: Install sd CLI to use later in the workflow | |
uses: levibostian/setup-sd@add-file-extension | |
- name: Install tools from Gemfile (ruby language) used for building our apps with | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.0' | |
bundler-cache: true | |
- name: Setup local.properties file for sample app | |
run: | | |
touch "samples/local.properties" | |
echo "sdkVersion=3.10.0" >> "samples/local.properties" | |
echo "siteId=${{ secrets[matrix.cio-siteid-secret-key] }}" >> "samples/local.properties" | |
echo "apiKey=${{ secrets[matrix.cio-apikey-secret-key] }}" >> "samples/local.properties" | |
- name: Verify gradle scripts are valid gradle scripts | |
uses: gradle/actions/wrapper-validation@v3 | |
- name: Set up Gradle Version ${{ matrix.gradle-version }} | |
uses: gradle/actions/setup-gradle@v3 | |
with: | |
gradle-version: ${{ matrix.gradle-version }} | |
- name: Update Gradle Wrapper | |
run: | | |
# If AGP version matches the default value, we don't need to specify further versions. | |
if [ "${{ matrix.config }}" = "8.3.1" ]; then | |
./scripts/update-gradle-compatibility.sh | |
else | |
./scripts/update-gradle-compatibility.sh \ | |
--agpVersion ${{ matrix.gradle-version }} \ | |
--gradlePluginVersion ${{ matrix.gradle-version }} \ | |
--javaVersion ${{ matrix.gradle-version }} \ | |
--kotlinJVMVersion ${{ matrix.gradle-version }} \ | |
--apkScaleVersion ${{ matrix.gradle-version }} \ | |
--packagingResourcesAction ${{ matrix.gradle-version }} | |
fi | |
- name: Build Sample App ${{ matrix.sample-app }} with Gradle Version ${{ matrix.gradle-version }} | |
run: gradle assembleRelease |