[#715] Use Gradle build cache action
Also fixed the checkProperties task to be compatible with Gradle 8.0
This commit is contained in:
parent
f5e0af6545
commit
c87d130066
|
@ -1,44 +0,0 @@
|
||||||
name: 'Setup Java and Dependency Cache'
|
|
||||||
description: "Configures the build environment and caches Gradle and dependencies."
|
|
||||||
runs:
|
|
||||||
using: "composite"
|
|
||||||
steps:
|
|
||||||
- name: Set Env
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
echo "home=${HOME}" >> "$GITHUB_ENV"
|
|
||||||
- name: Set up Java
|
|
||||||
uses: actions/setup-java@3f07048e3d294f56e9b90ac5ea2c6f74e9ad0f98
|
|
||||||
with:
|
|
||||||
distribution: 'temurin'
|
|
||||||
java-version: 17
|
|
||||||
- name: Disable Gradle Daemon
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
mkdir ~/.gradle
|
|
||||||
|
|
||||||
echo "org.gradle.daemon=false" >> ~/.gradle/gradle.properties
|
|
||||||
- name: Gradle Wrapper Cache
|
|
||||||
id: gradle-wrapper-cache
|
|
||||||
uses: actions/cache@6998d139ddd3e68c71e9e398d8e40b71a2f39812
|
|
||||||
with:
|
|
||||||
path: ~/.gradle/wrapper
|
|
||||||
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles(format('{0}{1}', github.workspace, '/gradle/wrapper/gradle-wrapper.properties')) }}
|
|
||||||
- name: Gradle Dependency Cache
|
|
||||||
id: gradle-dependency-cache
|
|
||||||
uses: actions/cache@6998d139ddd3e68c71e9e398d8e40b71a2f39812
|
|
||||||
with:
|
|
||||||
path: ~/.gradle/caches/modules-2
|
|
||||||
key: ${{ runner.os }}-gradle-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/gradle.properties')) }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-gradle-deps-
|
|
||||||
- name: Download Gradle
|
|
||||||
if: steps.gradle-wrapper-cache.outputs.cache-hit != 'true'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
./gradlew --version
|
|
||||||
- name: Download Dependencies
|
|
||||||
if: steps.gradle-dependency-cache.outputs.cache-hit != 'true'
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
./gradlew dependencies resolveAll
|
|
|
@ -5,7 +5,7 @@ updates:
|
||||||
schedule:
|
schedule:
|
||||||
interval: "daily"
|
interval: "daily"
|
||||||
|
|
||||||
- package-ecosystem: "github-actions"
|
- package-ecosystem: "docker"
|
||||||
directory: ".github/actions/setup/"
|
directory: ".github/actions/antivirus/"
|
||||||
schedule:
|
schedule:
|
||||||
interval: "daily"
|
interval: "daily"
|
|
@ -68,10 +68,17 @@ jobs:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
timeout-minutes: 1
|
timeout-minutes: 1
|
||||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
|
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
|
||||||
- name: Setup
|
- name: Set up Java
|
||||||
id: setup
|
uses: actions/setup-java@3f07048e3d294f56e9b90ac5ea2c6f74e9ad0f98
|
||||||
timeout-minutes: 12
|
timeout-minutes: 1
|
||||||
uses: ./.github/actions/setup
|
with:
|
||||||
|
distribution: 'temurin'
|
||||||
|
java-version: 17
|
||||||
|
- name: Set up Gradle
|
||||||
|
uses: gradle/gradle-build-action@3fbe033aaae657f011f88f29be9e65ed26bd29ef
|
||||||
|
timeout-minutes: 10
|
||||||
|
with:
|
||||||
|
gradle-home-cache-cleanup: true
|
||||||
- name: Export Google Services JSON
|
- name: Export Google Services JSON
|
||||||
env:
|
env:
|
||||||
FIREBASE_DEBUG_JSON_BASE64: ${{ secrets.FIREBASE_DEBUG_JSON_BASE64 }}
|
FIREBASE_DEBUG_JSON_BASE64: ${{ secrets.FIREBASE_DEBUG_JSON_BASE64 }}
|
||||||
|
@ -92,6 +99,10 @@ jobs:
|
||||||
service_account: ${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT }}
|
service_account: ${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT }}
|
||||||
workload_identity_provider: ${{ secrets.GOOGLE_PLAY_WORKLOAD_IDENTITY_PROVIDER }}
|
workload_identity_provider: ${{ secrets.GOOGLE_PLAY_WORKLOAD_IDENTITY_PROVIDER }}
|
||||||
access_token_lifetime: '1500s'
|
access_token_lifetime: '1500s'
|
||||||
|
- name: Set Env
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo "home=${HOME}" >> "$GITHUB_ENV"
|
||||||
- name: Export Signing Key
|
- name: Export Signing Key
|
||||||
env:
|
env:
|
||||||
SIGNING_KEYSTORE_BASE_64: ${{ secrets.UPLOAD_KEYSTORE_BASE_64 }}
|
SIGNING_KEYSTORE_BASE_64: ${{ secrets.UPLOAD_KEYSTORE_BASE_64 }}
|
||||||
|
|
|
@ -38,20 +38,6 @@ jobs:
|
||||||
timeout-minutes: 1
|
timeout-minutes: 1
|
||||||
uses: gradle/wrapper-validation-action@55e685c48d84285a5b0418cd094606e199cca3b6
|
uses: gradle/wrapper-validation-action@55e685c48d84285a5b0418cd094606e199cca3b6
|
||||||
|
|
||||||
prime_cache:
|
|
||||||
needs: validate_gradle_wrapper
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
timeout-minutes: 1
|
|
||||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
|
|
||||||
- name: Setup
|
|
||||||
id: setup
|
|
||||||
timeout-minutes: 12
|
|
||||||
uses: ./.github/actions/setup
|
|
||||||
|
|
||||||
check_firebase_secrets:
|
check_firebase_secrets:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
outputs:
|
||||||
|
@ -77,7 +63,7 @@ jobs:
|
||||||
run: echo "defined=true" >> $GITHUB_OUTPUT
|
run: echo "defined=true" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
check_properties:
|
check_properties:
|
||||||
needs: prime_cache
|
needs: validate_gradle_wrapper
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
@ -85,17 +71,22 @@ jobs:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
timeout-minutes: 1
|
timeout-minutes: 1
|
||||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
|
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
|
||||||
- name: Setup
|
- name: Set up Java
|
||||||
id: setup
|
uses: actions/setup-java@3f07048e3d294f56e9b90ac5ea2c6f74e9ad0f98
|
||||||
|
timeout-minutes: 1
|
||||||
|
with:
|
||||||
|
distribution: 'temurin'
|
||||||
|
java-version: 17
|
||||||
|
- name: Set up Gradle
|
||||||
|
uses: gradle/gradle-build-action@3fbe033aaae657f011f88f29be9e65ed26bd29ef
|
||||||
timeout-minutes: 5
|
timeout-minutes: 5
|
||||||
uses: ./.github/actions/setup
|
|
||||||
- name: Check properties
|
- name: Check properties
|
||||||
timeout-minutes: 4
|
timeout-minutes: 4
|
||||||
run: |
|
run: |
|
||||||
./gradlew checkProperties
|
./gradlew checkProperties
|
||||||
|
|
||||||
static_analysis_detekt:
|
static_analysis_detekt:
|
||||||
needs: prime_cache
|
needs: validate_gradle_wrapper
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
@ -103,10 +94,15 @@ jobs:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
timeout-minutes: 1
|
timeout-minutes: 1
|
||||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
|
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
|
||||||
- name: Setup
|
- name: Set up Java
|
||||||
id: setup
|
uses: actions/setup-java@3f07048e3d294f56e9b90ac5ea2c6f74e9ad0f98
|
||||||
|
timeout-minutes: 1
|
||||||
|
with:
|
||||||
|
distribution: 'temurin'
|
||||||
|
java-version: 17
|
||||||
|
- name: Set up Gradle
|
||||||
|
uses: gradle/gradle-build-action@3fbe033aaae657f011f88f29be9e65ed26bd29ef
|
||||||
timeout-minutes: 5
|
timeout-minutes: 5
|
||||||
uses: ./.github/actions/setup
|
|
||||||
- name: Detekt
|
- name: Detekt
|
||||||
timeout-minutes: 4
|
timeout-minutes: 4
|
||||||
run: |
|
run: |
|
||||||
|
@ -114,10 +110,10 @@ jobs:
|
||||||
- name: Collect Artifacts
|
- name: Collect Artifacts
|
||||||
timeout-minutes: 1
|
timeout-minutes: 1
|
||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
env:
|
|
||||||
ARTIFACTS_DIR_PATH: ${{ format('{0}/artifacts', env.home) }}
|
|
||||||
REPORTS_ZIP_PATH: ${{ format('{0}/artifacts/static_analysis_detekt.zip', env.home) }}
|
|
||||||
run: |
|
run: |
|
||||||
|
export ARTIFACTS_DIR_PATH=~/artifacts
|
||||||
|
export REPORTS_ZIP_PATH=${ARTIFACTS_DIR_PATH}/static_analysis_detekt.zip
|
||||||
|
|
||||||
mkdir ${ARTIFACTS_DIR_PATH}
|
mkdir ${ARTIFACTS_DIR_PATH}
|
||||||
|
|
||||||
zip -r ${REPORTS_ZIP_PATH} . -i build/reports/detekt/*
|
zip -r ${REPORTS_ZIP_PATH} . -i build/reports/detekt/*
|
||||||
|
@ -130,7 +126,7 @@ jobs:
|
||||||
path: ~/artifacts
|
path: ~/artifacts
|
||||||
|
|
||||||
static_analysis_ktlint:
|
static_analysis_ktlint:
|
||||||
needs: prime_cache
|
needs: validate_gradle_wrapper
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
@ -138,10 +134,15 @@ jobs:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
timeout-minutes: 1
|
timeout-minutes: 1
|
||||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
|
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
|
||||||
- name: Setup
|
- name: Set up Java
|
||||||
id: setup
|
uses: actions/setup-java@3f07048e3d294f56e9b90ac5ea2c6f74e9ad0f98
|
||||||
|
timeout-minutes: 1
|
||||||
|
with:
|
||||||
|
distribution: 'temurin'
|
||||||
|
java-version: 17
|
||||||
|
- name: Set up Gradle
|
||||||
|
uses: gradle/gradle-build-action@3fbe033aaae657f011f88f29be9e65ed26bd29ef
|
||||||
timeout-minutes: 5
|
timeout-minutes: 5
|
||||||
uses: ./.github/actions/setup
|
|
||||||
- name: Ktlint
|
- name: Ktlint
|
||||||
timeout-minutes: 4
|
timeout-minutes: 4
|
||||||
run: |
|
run: |
|
||||||
|
@ -149,10 +150,10 @@ jobs:
|
||||||
- name: Collect Artifacts
|
- name: Collect Artifacts
|
||||||
timeout-minutes: 1
|
timeout-minutes: 1
|
||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
env:
|
|
||||||
ARTIFACTS_DIR_PATH: ${{ format('{0}/artifacts', env.home) }}
|
|
||||||
REPORTS_ZIP_PATH: ${{ format('{0}/artifacts/static_analysis_ktlint.zip', env.home) }}
|
|
||||||
run: |
|
run: |
|
||||||
|
export ARTIFACTS_DIR_PATH=~/artifacts
|
||||||
|
export REPORTS_ZIP_PATH=${ARTIFACTS_DIR_PATH}/static_analysis_ktlint.zip
|
||||||
|
|
||||||
mkdir ${ARTIFACTS_DIR_PATH}
|
mkdir ${ARTIFACTS_DIR_PATH}
|
||||||
|
|
||||||
zip -r ${REPORTS_ZIP_PATH} . -i build/reports/ktlint/\*
|
zip -r ${REPORTS_ZIP_PATH} . -i build/reports/ktlint/\*
|
||||||
|
@ -165,7 +166,7 @@ jobs:
|
||||||
path: ~/artifacts
|
path: ~/artifacts
|
||||||
|
|
||||||
static_analysis_android_lint:
|
static_analysis_android_lint:
|
||||||
needs: prime_cache
|
needs: validate_gradle_wrapper
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
@ -173,10 +174,15 @@ jobs:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
timeout-minutes: 1
|
timeout-minutes: 1
|
||||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
|
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
|
||||||
- name: Setup
|
- name: Set up Java
|
||||||
id: setup
|
uses: actions/setup-java@3f07048e3d294f56e9b90ac5ea2c6f74e9ad0f98
|
||||||
|
timeout-minutes: 1
|
||||||
|
with:
|
||||||
|
distribution: 'temurin'
|
||||||
|
java-version: 17
|
||||||
|
- name: Set up Gradle
|
||||||
|
uses: gradle/gradle-build-action@3fbe033aaae657f011f88f29be9e65ed26bd29ef
|
||||||
timeout-minutes: 5
|
timeout-minutes: 5
|
||||||
uses: ./.github/actions/setup
|
|
||||||
- name: Android Lint
|
- name: Android Lint
|
||||||
timeout-minutes: 15
|
timeout-minutes: 15
|
||||||
env:
|
env:
|
||||||
|
@ -187,12 +193,13 @@ jobs:
|
||||||
- name: Collect Artifacts
|
- name: Collect Artifacts
|
||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
timeout-minutes: 1
|
timeout-minutes: 1
|
||||||
env:
|
|
||||||
ARTIFACTS_DIR_PATH: ${{ format('{0}/artifacts', env.home) }}
|
|
||||||
LINT_ZIP_PATH: ${{ format('{0}/artifacts/android_lint.zip', env.home) }}
|
|
||||||
run: |
|
run: |
|
||||||
|
export ARTIFACTS_DIR_PATH=~/artifacts
|
||||||
|
export LINT_ZIP_PATH=${ARTIFACTS_DIR_PATH}/android_lint.zip
|
||||||
|
|
||||||
mkdir ${ARTIFACTS_DIR_PATH}
|
mkdir ${ARTIFACTS_DIR_PATH}
|
||||||
zip -r ${LINT_ZIP_PATH} . -i *build/reports/*
|
|
||||||
|
zip -r ${LINT_ZIP_PATH} . -i \*build/reports/\*
|
||||||
- name: Upload Artifacts
|
- name: Upload Artifacts
|
||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce
|
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce
|
||||||
|
@ -202,7 +209,7 @@ jobs:
|
||||||
path: ~/artifacts
|
path: ~/artifacts
|
||||||
|
|
||||||
test_kotlin_modules:
|
test_kotlin_modules:
|
||||||
needs: prime_cache
|
needs: validate_gradle_wrapper
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
@ -210,10 +217,15 @@ jobs:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
timeout-minutes: 1
|
timeout-minutes: 1
|
||||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
|
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
|
||||||
- name: Setup
|
- name: Set up Java
|
||||||
id: setup
|
uses: actions/setup-java@3f07048e3d294f56e9b90ac5ea2c6f74e9ad0f98
|
||||||
|
timeout-minutes: 1
|
||||||
|
with:
|
||||||
|
distribution: 'temurin'
|
||||||
|
java-version: 17
|
||||||
|
- name: Set up Gradle
|
||||||
|
uses: gradle/gradle-build-action@3fbe033aaae657f011f88f29be9e65ed26bd29ef
|
||||||
timeout-minutes: 5
|
timeout-minutes: 5
|
||||||
uses: ./.github/actions/setup
|
|
||||||
- name: Test
|
- name: Test
|
||||||
timeout-minutes: 4
|
timeout-minutes: 4
|
||||||
run: |
|
run: |
|
||||||
|
@ -222,12 +234,13 @@ jobs:
|
||||||
- name: Collect Artifacts
|
- name: Collect Artifacts
|
||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
timeout-minutes: 1
|
timeout-minutes: 1
|
||||||
env:
|
|
||||||
ARTIFACTS_DIR_PATH: ${{ format('{0}/artifacts', env.home) }}
|
|
||||||
RESULTS_ZIP_PATH: ${{ format('{0}/artifacts/test_kotlin.zip', env.home) }}
|
|
||||||
run: |
|
run: |
|
||||||
|
export ARTIFACTS_DIR_PATH=~/artifacts
|
||||||
|
export RESULTS_ZIP_PATH=${ARTIFACTS_DIR_PATH}/test_kotlin.zip
|
||||||
|
|
||||||
mkdir ${ARTIFACTS_DIR_PATH}
|
mkdir ${ARTIFACTS_DIR_PATH}
|
||||||
zip -r ${RESULTS_ZIP_PATH} . -i *build/reports/*
|
|
||||||
|
zip -r ${RESULTS_ZIP_PATH} . -i \*build/reports/\*
|
||||||
- name: Upload Artifacts
|
- name: Upload Artifacts
|
||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce
|
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce
|
||||||
|
@ -239,7 +252,7 @@ jobs:
|
||||||
# Emulator.wtf is preferred if it has an API key.
|
# Emulator.wtf is preferred if it has an API key.
|
||||||
test_android_modules_ftl:
|
test_android_modules_ftl:
|
||||||
if: needs.check_firebase_secrets.outputs.has-secrets == 'true' && needs.check_emulator_wtf_secrets.outputs.has-secrets == 'false'
|
if: needs.check_firebase_secrets.outputs.has-secrets == 'true' && needs.check_emulator_wtf_secrets.outputs.has-secrets == 'false'
|
||||||
needs: [prime_cache, check_firebase_secrets, check_emulator_wtf_secrets]
|
needs: [validate_gradle_wrapper, check_firebase_secrets, check_emulator_wtf_secrets]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
@ -248,10 +261,15 @@ jobs:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
timeout-minutes: 1
|
timeout-minutes: 1
|
||||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
|
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
|
||||||
- name: Setup
|
- name: Set up Java
|
||||||
id: setup
|
uses: actions/setup-java@3f07048e3d294f56e9b90ac5ea2c6f74e9ad0f98
|
||||||
|
timeout-minutes: 1
|
||||||
|
with:
|
||||||
|
distribution: 'temurin'
|
||||||
|
java-version: 17
|
||||||
|
- name: Set up Gradle
|
||||||
|
uses: gradle/gradle-build-action@3fbe033aaae657f011f88f29be9e65ed26bd29ef
|
||||||
timeout-minutes: 5
|
timeout-minutes: 5
|
||||||
uses: ./.github/actions/setup
|
|
||||||
- name: Build
|
- name: Build
|
||||||
timeout-minutes: 20
|
timeout-minutes: 20
|
||||||
run: |
|
run: |
|
||||||
|
@ -280,10 +298,10 @@ jobs:
|
||||||
- name: Collect Artifacts
|
- name: Collect Artifacts
|
||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
timeout-minutes: 1
|
timeout-minutes: 1
|
||||||
env:
|
|
||||||
ARTIFACTS_DIR_PATH: ${{ format('{0}/artifacts', env.home) }}
|
|
||||||
TEST_RESULTS_ZIP_PATH: ${{ format('{0}/artifacts/test_results.zip', env.home) }}
|
|
||||||
run: |
|
run: |
|
||||||
|
export ARTIFACTS_DIR_PATH=~/artifacts
|
||||||
|
export TEST_RESULTS_ZIP_PATH=${ARTIFACTS_DIR_PATH}/test_results.zip
|
||||||
|
|
||||||
mkdir ${ARTIFACTS_DIR_PATH}
|
mkdir ${ARTIFACTS_DIR_PATH}
|
||||||
|
|
||||||
zip -r ${TEST_RESULTS_ZIP_PATH} . -i build/fladle/\* \*/build/outputs/androidTest-results/\*
|
zip -r ${TEST_RESULTS_ZIP_PATH} . -i build/fladle/\* \*/build/outputs/androidTest-results/\*
|
||||||
|
@ -297,7 +315,7 @@ jobs:
|
||||||
|
|
||||||
test_android_modules_wtf_coverage:
|
test_android_modules_wtf_coverage:
|
||||||
if: needs.check_emulator_wtf_secrets.outputs.has-secrets == 'true'
|
if: needs.check_emulator_wtf_secrets.outputs.has-secrets == 'true'
|
||||||
needs: [ prime_cache, check_emulator_wtf_secrets ]
|
needs: [ validate_gradle_wrapper, check_emulator_wtf_secrets ]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
@ -305,10 +323,15 @@ jobs:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
timeout-minutes: 1
|
timeout-minutes: 1
|
||||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
|
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
|
||||||
- name: Setup
|
- name: Set up Java
|
||||||
id: setup
|
uses: actions/setup-java@3f07048e3d294f56e9b90ac5ea2c6f74e9ad0f98
|
||||||
|
timeout-minutes: 1
|
||||||
|
with:
|
||||||
|
distribution: 'temurin'
|
||||||
|
java-version: 17
|
||||||
|
- name: Set up Gradle
|
||||||
|
uses: gradle/gradle-build-action@3fbe033aaae657f011f88f29be9e65ed26bd29ef
|
||||||
timeout-minutes: 5
|
timeout-minutes: 5
|
||||||
uses: ./.github/actions/setup
|
|
||||||
- name: Build and test
|
- name: Build and test
|
||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
env:
|
env:
|
||||||
|
@ -322,10 +345,10 @@ jobs:
|
||||||
- name: Collect Artifacts
|
- name: Collect Artifacts
|
||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
timeout-minutes: 1
|
timeout-minutes: 1
|
||||||
env:
|
|
||||||
ARTIFACTS_DIR_PATH: ${{ format('{0}/artifacts', env.home) }}
|
|
||||||
TEST_RESULTS_ZIP_PATH: ${{ format('{0}/artifacts/test_results.zip', env.home) }}
|
|
||||||
run: |
|
run: |
|
||||||
|
export ARTIFACTS_DIR_PATH=~/artifacts
|
||||||
|
export TEST_RESULTS_ZIP_PATH=${ARTIFACTS_DIR_PATH}/test_results.zip
|
||||||
|
|
||||||
mkdir ${ARTIFACTS_DIR_PATH}
|
mkdir ${ARTIFACTS_DIR_PATH}
|
||||||
|
|
||||||
zip -r ${TEST_RESULTS_ZIP_PATH} . -i \*/build/test-results/\*
|
zip -r ${TEST_RESULTS_ZIP_PATH} . -i \*/build/test-results/\*
|
||||||
|
@ -339,7 +362,7 @@ jobs:
|
||||||
|
|
||||||
test_android_modules_wtf_no_coverage:
|
test_android_modules_wtf_no_coverage:
|
||||||
if: needs.check_emulator_wtf_secrets.outputs.has-secrets == 'true'
|
if: needs.check_emulator_wtf_secrets.outputs.has-secrets == 'true'
|
||||||
needs: [ prime_cache, check_emulator_wtf_secrets ]
|
needs: [ validate_gradle_wrapper, check_emulator_wtf_secrets ]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
@ -347,10 +370,15 @@ jobs:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
timeout-minutes: 1
|
timeout-minutes: 1
|
||||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
|
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
|
||||||
- name: Setup
|
- name: Set up Java
|
||||||
id: setup
|
uses: actions/setup-java@3f07048e3d294f56e9b90ac5ea2c6f74e9ad0f98
|
||||||
|
timeout-minutes: 1
|
||||||
|
with:
|
||||||
|
distribution: 'temurin'
|
||||||
|
java-version: 17
|
||||||
|
- name: Set up Gradle
|
||||||
|
uses: gradle/gradle-build-action@3fbe033aaae657f011f88f29be9e65ed26bd29ef
|
||||||
timeout-minutes: 5
|
timeout-minutes: 5
|
||||||
uses: ./.github/actions/setup
|
|
||||||
- name: Build and test
|
- name: Build and test
|
||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
env:
|
env:
|
||||||
|
@ -362,10 +390,10 @@ jobs:
|
||||||
- name: Collect Artifacts
|
- name: Collect Artifacts
|
||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
timeout-minutes: 1
|
timeout-minutes: 1
|
||||||
env:
|
|
||||||
ARTIFACTS_DIR_PATH: ${{ format('{0}/artifacts', env.home) }}
|
|
||||||
TEST_RESULTS_ZIP_PATH: ${{ format('{0}/artifacts/test_results.zip', env.home) }}
|
|
||||||
run: |
|
run: |
|
||||||
|
export ARTIFACTS_DIR_PATH=~/artifacts
|
||||||
|
export TEST_RESULTS_ZIP_PATH=${ARTIFACTS_DIR_PATH}/test_results.zip
|
||||||
|
|
||||||
mkdir ${ARTIFACTS_DIR_PATH}
|
mkdir ${ARTIFACTS_DIR_PATH}
|
||||||
|
|
||||||
zip -r ${TEST_RESULTS_ZIP_PATH} . -i \*/build/test-results/\*
|
zip -r ${TEST_RESULTS_ZIP_PATH} . -i \*/build/test-results/\*
|
||||||
|
@ -390,10 +418,15 @@ jobs:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
timeout-minutes: 1
|
timeout-minutes: 1
|
||||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
|
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
|
||||||
- name: Setup
|
- name: Set up Java
|
||||||
id: setup
|
uses: actions/setup-java@3f07048e3d294f56e9b90ac5ea2c6f74e9ad0f98
|
||||||
|
timeout-minutes: 1
|
||||||
|
with:
|
||||||
|
distribution: 'temurin'
|
||||||
|
java-version: 17
|
||||||
|
- name: Set up Gradle
|
||||||
|
uses: gradle/gradle-build-action@3fbe033aaae657f011f88f29be9e65ed26bd29ef
|
||||||
timeout-minutes: 5
|
timeout-minutes: 5
|
||||||
uses: ./.github/actions/setup
|
|
||||||
- name: Export Google Services JSON
|
- name: Export Google Services JSON
|
||||||
env:
|
env:
|
||||||
FIREBASE_DEBUG_JSON_BASE64: ${{ secrets.FIREBASE_DEBUG_JSON_BASE64 }}
|
FIREBASE_DEBUG_JSON_BASE64: ${{ secrets.FIREBASE_DEBUG_JSON_BASE64 }}
|
||||||
|
@ -430,7 +463,7 @@ jobs:
|
||||||
./gradlew :app:runFlankSanityConfigDebug
|
./gradlew :app:runFlankSanityConfigDebug
|
||||||
|
|
||||||
build:
|
build:
|
||||||
needs: prime_cache
|
needs: validate_gradle_wrapper
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
@ -438,10 +471,15 @@ jobs:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
timeout-minutes: 1
|
timeout-minutes: 1
|
||||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
|
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
|
||||||
- name: Setup
|
- name: Set up Java
|
||||||
id: setup
|
uses: actions/setup-java@3f07048e3d294f56e9b90ac5ea2c6f74e9ad0f98
|
||||||
|
timeout-minutes: 1
|
||||||
|
with:
|
||||||
|
distribution: 'temurin'
|
||||||
|
java-version: 17
|
||||||
|
- name: Set up Gradle
|
||||||
|
uses: gradle/gradle-build-action@3fbe033aaae657f011f88f29be9e65ed26bd29ef
|
||||||
timeout-minutes: 5
|
timeout-minutes: 5
|
||||||
uses: ./.github/actions/setup
|
|
||||||
- name: Export Google Services JSON
|
- name: Export Google Services JSON
|
||||||
env:
|
env:
|
||||||
FIREBASE_DEBUG_JSON_BASE64: ${{ secrets.FIREBASE_DEBUG_JSON_BASE64 }}
|
FIREBASE_DEBUG_JSON_BASE64: ${{ secrets.FIREBASE_DEBUG_JSON_BASE64 }}
|
||||||
|
@ -453,6 +491,10 @@ jobs:
|
||||||
mkdir -p app/src/release/
|
mkdir -p app/src/release/
|
||||||
echo ${FIREBASE_DEBUG_JSON_BASE64} | base64 --decode > app/src/debug/google-services.json
|
echo ${FIREBASE_DEBUG_JSON_BASE64} | base64 --decode > app/src/debug/google-services.json
|
||||||
echo ${FIREBASE_RELEASE_JSON_BASE64} | base64 --decode > app/src/release/google-services.json
|
echo ${FIREBASE_RELEASE_JSON_BASE64} | base64 --decode > app/src/release/google-services.json
|
||||||
|
- name: Set Env
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo "home=${HOME}" >> "$GITHUB_ENV"
|
||||||
# A fake signing key to satisfy creating a "release" build
|
# A fake signing key to satisfy creating a "release" build
|
||||||
- name: Export Signing Key
|
- name: Export Signing Key
|
||||||
env:
|
env:
|
||||||
|
@ -499,10 +541,15 @@ jobs:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
timeout-minutes: 1
|
timeout-minutes: 1
|
||||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
|
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
|
||||||
- name: Setup
|
- name: Set up Java
|
||||||
id: setup
|
uses: actions/setup-java@3f07048e3d294f56e9b90ac5ea2c6f74e9ad0f98
|
||||||
|
timeout-minutes: 1
|
||||||
|
with:
|
||||||
|
distribution: 'temurin'
|
||||||
|
java-version: 17
|
||||||
|
- name: Set up Gradle
|
||||||
|
uses: gradle/gradle-build-action@3fbe033aaae657f011f88f29be9e65ed26bd29ef
|
||||||
timeout-minutes: 5
|
timeout-minutes: 5
|
||||||
uses: ./.github/actions/setup
|
|
||||||
- name: Authenticate to Google Cloud for Firebase Test Lab
|
- name: Authenticate to Google Cloud for Firebase Test Lab
|
||||||
id: auth_test_lab
|
id: auth_test_lab
|
||||||
uses: google-github-actions/auth@ef5d53e30bbcd8d0836f4288f5e50ff3e086997d
|
uses: google-github-actions/auth@ef5d53e30bbcd8d0836f4288f5e50ff3e086997d
|
||||||
|
|
|
@ -84,44 +84,46 @@ tasks {
|
||||||
}
|
}
|
||||||
|
|
||||||
register("checkProperties") {
|
register("checkProperties") {
|
||||||
|
// Ensure that developers do not change default values of certain properties directly
|
||||||
|
// in the repo, but instead set them in their local ~/.gradle/gradle.properties file
|
||||||
|
// (or use command line arguments)
|
||||||
|
val expectedPropertyValues = mapOf(
|
||||||
|
"ZCASH_IS_TREAT_WARNINGS_AS_ERRORS" to "true",
|
||||||
|
"IS_KOTLIN_TEST_COVERAGE_ENABLED" to "true",
|
||||||
|
"IS_ANDROID_INSTRUMENTATION_TEST_COVERAGE_ENABLED" to "false",
|
||||||
|
"IS_USE_TEST_ORCHESTRATOR" to "false",
|
||||||
|
"IS_CRASH_ON_STRICT_MODE_VIOLATION" to "false",
|
||||||
|
|
||||||
|
"ZCASH_FIREBASE_TEST_LAB_API_KEY_PATH" to "",
|
||||||
|
"ZCASH_FIREBASE_TEST_LAB_PROJECT" to "",
|
||||||
|
|
||||||
|
"ZCASH_EMULATOR_WTF_API_KEY" to "",
|
||||||
|
|
||||||
|
"IS_MINIFY_ENABLED" to "true",
|
||||||
|
|
||||||
|
"ZCASH_RELEASE_APP_NAME" to "Zcash",
|
||||||
|
"ZCASH_RELEASE_PACKAGE_NAME" to "co.electriccoin.zcash",
|
||||||
|
|
||||||
|
"ZCASH_DEBUG_KEYSTORE_PATH" to "",
|
||||||
|
"ZCASH_RELEASE_KEYSTORE_PATH" to "",
|
||||||
|
"ZCASH_RELEASE_KEYSTORE_PASSWORD" to "",
|
||||||
|
"ZCASH_RELEASE_KEY_ALIAS" to "",
|
||||||
|
"ZCASH_RELEASE_KEY_ALIAS_PASSWORD" to "",
|
||||||
|
|
||||||
|
"IS_SIGN_RELEASE_BUILD_WITH_DEBUG_KEY" to "false",
|
||||||
|
|
||||||
|
"ZCASH_GOOGLE_PLAY_SERVICE_KEY_FILE_PATH" to "",
|
||||||
|
"ZCASH_GOOGLE_PLAY_DEPLOY_MODE" to "build",
|
||||||
|
|
||||||
|
"SDK_INCLUDED_BUILD_PATH" to "",
|
||||||
|
"BIP_39_INCLUDED_BUILD_PATH" to ""
|
||||||
|
)
|
||||||
|
|
||||||
|
val actualPropertyValues = project.properties.filterKeys { it in expectedPropertyValues.keys }
|
||||||
|
|
||||||
doLast {
|
doLast {
|
||||||
// Ensure that developers do not change default values of certain properties directly
|
|
||||||
// in the repo, but instead set them in their local ~/.gradle/gradle.properties file
|
|
||||||
// (or use command line arguments)
|
|
||||||
val expectedPropertyValues = mapOf(
|
|
||||||
"ZCASH_IS_TREAT_WARNINGS_AS_ERRORS" to "true",
|
|
||||||
"IS_KOTLIN_TEST_COVERAGE_ENABLED" to "true",
|
|
||||||
"IS_ANDROID_INSTRUMENTATION_TEST_COVERAGE_ENABLED" to "false",
|
|
||||||
"IS_USE_TEST_ORCHESTRATOR" to "false",
|
|
||||||
"IS_CRASH_ON_STRICT_MODE_VIOLATION" to "false",
|
|
||||||
|
|
||||||
"ZCASH_FIREBASE_TEST_LAB_API_KEY_PATH" to "",
|
|
||||||
"ZCASH_FIREBASE_TEST_LAB_PROJECT" to "",
|
|
||||||
|
|
||||||
"ZCASH_EMULATOR_WTF_API_KEY" to "",
|
|
||||||
|
|
||||||
"IS_MINIFY_ENABLED" to "true",
|
|
||||||
|
|
||||||
"ZCASH_RELEASE_APP_NAME" to "Zcash",
|
|
||||||
"ZCASH_RELEASE_PACKAGE_NAME" to "co.electriccoin.zcash",
|
|
||||||
|
|
||||||
"ZCASH_DEBUG_KEYSTORE_PATH" to "",
|
|
||||||
"ZCASH_RELEASE_KEYSTORE_PATH" to "",
|
|
||||||
"ZCASH_RELEASE_KEYSTORE_PASSWORD" to "",
|
|
||||||
"ZCASH_RELEASE_KEY_ALIAS" to "",
|
|
||||||
"ZCASH_RELEASE_KEY_ALIAS_PASSWORD" to "",
|
|
||||||
|
|
||||||
"IS_SIGN_RELEASE_BUILD_WITH_DEBUG_KEY" to "false",
|
|
||||||
|
|
||||||
"ZCASH_GOOGLE_PLAY_SERVICE_KEY_FILE_PATH" to "",
|
|
||||||
"ZCASH_GOOGLE_PLAY_DEPLOY_MODE" to "build",
|
|
||||||
|
|
||||||
"SDK_INCLUDED_BUILD_PATH" to "",
|
|
||||||
"BIP_39_INCLUDED_BUILD_PATH" to ""
|
|
||||||
)
|
|
||||||
|
|
||||||
val warnings = expectedPropertyValues.filter { (key, value) ->
|
val warnings = expectedPropertyValues.filter { (key, value) ->
|
||||||
project.properties[key].toString() != value
|
actualPropertyValues[key].toString() != value
|
||||||
}.map { "Property ${it.key} does not have expected value \"${it.value}\"" }
|
}.map { "Property ${it.key} does not have expected value \"${it.value}\"" }
|
||||||
|
|
||||||
if (warnings.isNotEmpty()) {
|
if (warnings.isNotEmpty()) {
|
||||||
|
|
Loading…
Reference in New Issue