Skip to content

Commit 617490c

Browse files
authored
Merge pull request #677 from square/rick/CI_Gradle_Cache_Action
use burrunan/gradle-cache-action in CI
2 parents b0ef5c7 + 688d842 commit 617490c

File tree

1 file changed

+42
-11
lines changed

1 file changed

+42
-11
lines changed

.github/workflows/kotlin.yml

Lines changed: 42 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,31 @@ jobs:
2222
java-version: 11.0.7
2323

2424
## Actual task
25-
- name: Assemble with gradle — make sure everything builds
26-
run: ./gradlew assemble --no-daemon --stacktrace
25+
- uses : burrunan/gradle-cache-action@v1
26+
name : Assemble with gradle — make sure everything builds
27+
with :
28+
gradle-dependencies-cache-key : |
29+
gradle/libs.versions.toml
30+
arguments : |
31+
assemble --no-daemon --stacktrace
32+
concurrent : true
33+
gradle-build-scan-report : false
34+
gradle-distribution-sha-256-sum-warning : false
2735

2836
# This should ideally be done as a Check job below, but it needs to be done as a separate
2937
# step after running assemble. Heckin' ridikalus.
3038
# Probably fixed in dokka 1.4.10, but we can't move to kotlin 1.4 yet.
3139
# https://github.com/square/workflow/issues/1152.
32-
- name: Run dokka to validate kdoc
33-
run: ./gradlew siteDokka --build-cache --no-daemon --stacktrace
40+
- uses : burrunan/gradle-cache-action@v1
41+
name : Run dokka to validate kdoc
42+
with :
43+
gradle-dependencies-cache-key : |
44+
gradle/libs.versions.toml
45+
arguments : |
46+
siteDokka --build-cache --no-daemon --stacktrace
47+
concurrent : true
48+
gradle-build-scan-report : false
49+
gradle-distribution-sha-256-sum-warning : false
3450

3551
# These are all pretty quick so we run them on a single shard. Fewer shards, less queueing.
3652
check:
@@ -46,13 +62,16 @@ jobs:
4662
java-version: 11.0.7
4763

4864
## Actual task
49-
- name: Check with Gradle
50-
run: ./gradlew test apiCheck lint ktlintCheck jmhJar --no-daemon --stacktrace --continue
51-
# Decoder:
52-
# --continue: Run all checks, even if some fail.
53-
# test: unit tests
54-
# apiCheck: binary compatibility
55-
# jmhJar: Build the JMH benchmarks to verify, but don't run them
65+
- uses : burrunan/gradle-cache-action@v1
66+
name : Check with Gradle
67+
with :
68+
gradle-dependencies-cache-key : |
69+
gradle/libs.versions.toml
70+
arguments : |
71+
test apiCheck lint ktlintCheck jmhJar --no-daemon --stacktrace --continue
72+
concurrent : true
73+
gradle-build-scan-report : false
74+
gradle-distribution-sha-256-sum-warning : false
5675

5776
instrumentation-tests:
5877
name: Instrumentation tests
@@ -73,6 +92,18 @@ jobs:
7392
with:
7493
java-version: 11.0.7
7594

95+
## Build before running tests, using cache.
96+
- uses : burrunan/gradle-cache-action@v1
97+
name : Build instrumented tests
98+
with :
99+
gradle-dependencies-cache-key : |
100+
gradle/libs.versions.toml
101+
arguments : |
102+
assembleDebugAndroidTest --no-daemon --stacktrace
103+
concurrent : true
104+
gradle-build-scan-report : false
105+
gradle-distribution-sha-256-sum-warning : false
106+
76107
## Actual task
77108
- name: Instrumentation Tests
78109
uses: reactivecircus/android-emulator-runner@v2

0 commit comments

Comments
 (0)