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

Commit 24f9b4d

Browse files
authored
Use gradle-build-action on CI (#39)
* Use gradle-build-action on CI * Use gradle-build-action before android-emulator-runner * Add avd-cache id * Add AVD cache back
1 parent 6c890af commit 24f9b4d

File tree

2 files changed

+14
-34
lines changed

2 files changed

+14
-34
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,12 @@ jobs:
3535
with:
3636
distribution: 'zulu'
3737
java-version: 17
38-
- uses: actions/cache@v2
39-
with:
40-
path: |
41-
~/.gradle/caches
42-
~/.gradle/wrapper
43-
key: ${{ runner.os }}-gradle-${{ hashFiles('**/**.gradle', '**/**.gradle.kts', '**/gradle/wrapper/gradle-wrapper.properties', '**/buildSrc/src/main/kotlin/**.kt') }}
4438
- name: Validate Gradle Wrapper
4539
uses: gradle/wrapper-validation-action@v1
4640
- name: Check style
47-
run: ./gradlew ktlintCheck
41+
uses: gradle/gradle-build-action@v2
42+
with:
43+
arguments: ktlintCheck
4844

4945
unit-tests:
5046
name: Unit tests
@@ -56,14 +52,10 @@ jobs:
5652
with:
5753
distribution: 'zulu'
5854
java-version: 17
59-
- uses: actions/cache@v2
60-
with:
61-
path: |
62-
~/.gradle/caches
63-
~/.gradle/wrapper
64-
key: ${{ runner.os }}-gradle-${{ hashFiles('**/**.gradle', '**/**.gradle.kts', '**/gradle/wrapper/gradle-wrapper.properties', '**/buildSrc/src/main/kotlin/**.kt') }}
6555
- name: Unit tests
66-
run: ./gradlew test
56+
uses: gradle/gradle-build-action@v2
57+
with:
58+
arguments: test
6759

6860
instrumentation-tests:
6961
name: Instrumentation tests
@@ -79,12 +71,8 @@ jobs:
7971
with:
8072
distribution: 'zulu'
8173
java-version: 17
82-
- uses: actions/cache@v2
83-
with:
84-
path: |
85-
~/.gradle/caches
86-
~/.gradle/wrapper
87-
key: ${{ runner.os }}-gradle-${{ hashFiles('**/**.gradle', '**/**.gradle.kts', '**/gradle/wrapper/gradle-wrapper.properties', '**/buildSrc/src/main/kotlin/**.kt') }}
74+
- name: Gradle cache
75+
uses: gradle/gradle-build-action@v2
8876
- name: AVD cache
8977
uses: actions/cache@v2
9078
id: avd-cache
@@ -123,14 +111,10 @@ jobs:
123111
with:
124112
distribution: 'zulu'
125113
java-version: 17
126-
- uses: actions/cache@v2
127-
with:
128-
path: |
129-
~/.gradle/caches
130-
~/.gradle/wrapper
131-
key: ${{ runner.os }}-gradle-${{ hashFiles('**/**.gradle', '**/**.gradle.kts', '**/gradle/wrapper/gradle-wrapper.properties', '**/buildSrc/src/main/kotlin/**.kt') }}
132114
- name: Build
133-
run: ./gradlew app:assemble
115+
uses: gradle/gradle-build-action@v2
116+
with:
117+
arguments: app:assemble
134118
- uses: actions/upload-artifact@v2
135119
if: matrix.os == 'ubuntu-latest'
136120
with:

.github/workflows/release.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,10 @@ jobs:
1515
with:
1616
distribution: 'zulu'
1717
java-version: 17
18-
- uses: actions/cache@v2
19-
with:
20-
path: |
21-
~/.gradle/caches
22-
~/.gradle/wrapper
23-
key: ${{ runner.os }}-gradle-${{ hashFiles('**/**.gradle', '**/**.gradle.kts', '**/gradle/wrapper/gradle-wrapper.properties', '**/buildSrc/src/main/kotlin/**.kt') }}
2418
- name: Build APK
25-
run: ./gradlew app:assembleProdRelease
19+
uses: gradle/gradle-build-action@v2
20+
with:
21+
arguments: app:assembleProdRelease
2622
- name: Create Release
2723
uses: ncipollo/release-action@v1
2824
with:

0 commit comments

Comments
 (0)