Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

Use gradle-build-action on CI #39

Merged
merged 4 commits into from
Mar 1, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 14 additions & 37 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,12 @@ jobs:
with:
distribution: 'zulu'
java-version: 17
- uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/**.gradle', '**/**.gradle.kts', '**/gradle/wrapper/gradle-wrapper.properties', '**/buildSrc/src/main/kotlin/**.kt') }}
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
- name: Check style
run: ./gradlew ktlintCheck
uses: gradle/gradle-build-action@v2
with:
arguments: ktlintCheck

unit-tests:
name: Unit tests
Expand All @@ -56,14 +52,10 @@ jobs:
with:
distribution: 'zulu'
java-version: 17
- uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/**.gradle', '**/**.gradle.kts', '**/gradle/wrapper/gradle-wrapper.properties', '**/buildSrc/src/main/kotlin/**.kt') }}
- name: Unit tests
run: ./gradlew test
uses: gradle/gradle-build-action@v2
with:
arguments: test

instrumentation-tests:
name: Instrumentation tests
Expand All @@ -79,20 +71,6 @@ jobs:
with:
distribution: 'zulu'
java-version: 17
- uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/**.gradle', '**/**.gradle.kts', '**/gradle/wrapper/gradle-wrapper.properties', '**/buildSrc/src/main/kotlin/**.kt') }}
- name: AVD cache
uses: actions/cache@v2
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
Expand All @@ -102,14 +80,17 @@ jobs:
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: false
script: echo "Generated AVD snapshot for caching."
- name: Instrumentation tests
- name: Prepare instrumentation
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
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: ./gradlew connectedDebugAndroidTest
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error: Input required and not supplied: script

- name: Instrumentation tests
uses: gradle/gradle-build-action@v2
with:
arguments: connectedDebugAndroidTest

build:
name: Build
Expand All @@ -123,14 +104,10 @@ jobs:
with:
distribution: 'zulu'
java-version: 17
- uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/**.gradle', '**/**.gradle.kts', '**/gradle/wrapper/gradle-wrapper.properties', '**/buildSrc/src/main/kotlin/**.kt') }}
- name: Build
run: ./gradlew app:assemble
uses: gradle/gradle-build-action@v2
with:
arguments: app:assemble
- uses: actions/upload-artifact@v2
if: matrix.os == 'ubuntu-latest'
with:
Expand Down
10 changes: 3 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,10 @@ jobs:
with:
distribution: 'zulu'
java-version: 17
- uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/**.gradle', '**/**.gradle.kts', '**/gradle/wrapper/gradle-wrapper.properties', '**/buildSrc/src/main/kotlin/**.kt') }}
- name: Build APK
run: ./gradlew app:assembleProdRelease
uses: gradle/gradle-build-action@v2
with:
arguments: app:assembleProdRelease
- name: Create Release
uses: ncipollo/release-action@v1
with:
Expand Down