-
Notifications
You must be signed in to change notification settings - Fork 226
72 lines (58 loc) · 2.27 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: CI
on: [push, pull_request]
jobs:
build:
runs-on: macOS-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Gradle Wrapper Validation
uses: gradle/wrapper-validation-action@v1
- name: Install JDK
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '17'
- name: Install Android SDK
uses: malinskiy/action-android/install-sdk@release/0.1.2
- run: sdkmanager platform-tools
# TODO Caching disabled for now due to the size of Gradle's cache rendering this super slow
# - name: Cache build .gradle dir
# uses: actions/cache@v1.0.1
# with:
# path: .gradle
# key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
# restore-keys: |
# ${{ runner.os }}-gradle-
# - name: Cache user .gradle dir
# uses: actions/cache@v1.0.1
# with:
# path: ~/.gradle
# key: ${{ runner.os }}-gradleuser-${{ hashFiles('**/*.gradle') }}
# restore-keys: |
# ${{ runner.os }}-gradleuser-
- name: Configure Gradle
# Initial gradle configuration, install dependencies, etc
run: ./gradlew help
- name: Spot check
# Run spotless first to fail fast on spotless issues
run: ./gradlew spotlessCheck --stacktrace
- name: Build project
run: ./gradlew assemble --stacktrace
# TODO split test and instrumentation into parallel builds
- name: Run tests
run: ./gradlew test --stacktrace
- name: Run instrumentation tests
uses: malinskiy/action-android/emulator-run-cmd@release/0.1.2
with:
cmd: ./gradlew connectedCheck --stacktrace
api: 18
tag: default
abi: x86
- name: Reclaim memory
run: ./gradlew --stop && jps|grep -E 'KotlinCompileDaemon|GradleDaemon'| awk '{print $1}'| xargs kill -9
- name: Final checks
run: ./gradlew check --stacktrace
- name: Upload snapshot (main only)
run: ./gradlew publish -PmavenCentralUsername="${{ secrets.SonatypeUsername }}" -PmavenCentralPassword="${{ secrets.SonatypePassword }}"
if: success() && github.ref == 'refs/heads/main' && github.event_name != 'pull_request'