Update dependency gradle to v8.12 #281
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: Pull Request CI | |
on: pull_request | |
jobs: | |
setup: | |
runs-on: ubuntu-latest | |
timeout-minutes: 3 | |
steps: | |
- name: Cancel Old Workflows | |
uses: styfle/cancel-workflow-action@0.11.0 | |
with: | |
workflow_id: update-screenshots-baseline.yml,pull-request.yml | |
access_token: ${{ github.token }} | |
spotless: | |
name: Spotless | |
needs: setup | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Copy CI gradle.properties | |
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties | |
- uses: gradle/wrapper-validation-action@v1 | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: 17 | |
- name: Cache Gradle packages | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/gradle-wrapper.properties', '**/libs.versions.toml') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
- name: Spotless | |
run: ./gradlew spotlessCheck | |
working-directory: . | |
- name: Cleanup Gradle Cache | |
run: | | |
rm -f ~/.gradle/caches/modules-2/modules-2.lock | |
rm -f ~/.gradle/caches/modules-2/gc.properties | |
build: | |
name: Build | |
needs: setup | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Copy CI gradle.properties | |
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties | |
- uses: gradle/wrapper-validation-action@v1 | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: 17 | |
- name: Cache Gradle packages | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/gradle-wrapper.properties', '**/libs.versions.toml') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
- name: Build | |
# https://github.com/autonomousapps/dependency-analysis-android-gradle-plugin/issues/884 | |
# run: ./gradlew build detekt projectHealth | |
run: ./gradlew build detekt | |
working-directory: . | |
- name: Cleanup Gradle Cache | |
run: | | |
rm -f ~/.gradle/caches/modules-2/modules-2.lock | |
rm -f ~/.gradle/caches/modules-2/gc.properties | |
publish-dry-run: | |
name: Publish dry run | |
needs: setup | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Copy CI gradle.properties | |
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties | |
- uses: gradle/wrapper-validation-action@v1 | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: 17 | |
- name: Cache Gradle packages | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/gradle-wrapper.properties', '**/libs.versions.toml') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
- name: PublishToMavenLocal | |
run: | | |
echo "Create .gpg key" | |
echo $GPG_KEY_ARMOR | base64 --decode > ./release.asc | |
gpg --quiet --output $GITHUB_WORKSPACE/release.gpg --dearmor ./release.asc | |
sed -i -e "s,mavenCentralUsername=,mavenCentralUsername=$SONATYPE_USERNAME,g" gradle.properties | |
sed -i -e "s,mavenCentralPassword=,mavenCentralPassword=$SONATYPE_PASSWORD,g" gradle.properties | |
sed -i -e "s,signing.keyId=,signing.keyId=$GPG_KEY_ID,g" gradle.properties | |
sed -i -e "s,signing.password=,signing.password=$GPG_PASSWORD,g" gradle.properties | |
sed -i -e "s,signing.secretKeyRingFile=,signing.secretKeyRingFile=$GITHUB_WORKSPACE/release.gpg,g" gradle.properties | |
./gradlew publishToMavenLocal --no-daemon --no-parallel | |
env: | |
GPG_KEY_ARMOR: "${{ secrets.GPG_KEY_ARMOR }}" | |
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }} | |
GPG_PASSWORD: ${{ secrets.GPG_KEY_PASSWORD }} | |
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | |
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | |
- name: Cleanup Gradle Cache | |
run: | | |
rm -f ~/.gradle/caches/modules-2/modules-2.lock | |
rm -f ~/.gradle/caches/modules-2/gc.properties | |
instrumentation-tests: | |
name: Instrumentation tests | |
needs: spotless | |
runs-on: macOS-latest | |
timeout-minutes: 45 | |
strategy: | |
fail-fast: false | |
matrix: | |
api-level: [29] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Copy CI gradle.properties | |
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties | |
- uses: gradle/wrapper-validation-action@v1 | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: 17 | |
- name: Cache Gradle packages | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/gradle-wrapper.properties', '**/libs.versions.toml') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
- name: AVD cache | |
uses: actions/cache@v3 | |
id: avd-cache | |
with: | |
path: | | |
~/.android/avd/* | |
~/.android/adb* | |
key: avd-${{ matrix.api-level }} | |
- name: create AVD and generate snapshot for caching | |
if: steps.avd-cache.outputs.cache-hit != 'true' | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: ${{ matrix.api-level }} | |
arch: x86_64 | |
force-avd-creation: false | |
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | |
disable-animations: true | |
script: echo "Generated AVD snapshot for caching." | |
- name: Instrumentation tests | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: ${{ matrix.api-level }} | |
arch: x86_64 | |
force-avd-creation: false | |
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | |
disable-animations: true | |
script: | | |
adb logcat > logcat.out & | |
adb uninstall net.lachlanmckee.jetpack.navigation.hilt.debug.test & adb uninstall net.lachlanmckee.jetpack.navigation.hilt.debug & | |
./gradlew connectedCheck --stacktrace | |
- name: Upload instrumentation test reports | |
if: failure() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: instrumentation-failure-${{ matrix.api-level }} | |
path: | | |
**/build/reports | |
logcat.out | |
- name: Cleanup Gradle Cache | |
run: | | |
rm -f ~/.gradle/caches/modules-2/modules-2.lock | |
rm -f ~/.gradle/caches/modules-2/gc.properties |