-
Notifications
You must be signed in to change notification settings - Fork 7
106 lines (98 loc) · 3.32 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: CI
on:
push:
branches:
- master
pull_request:
jobs:
check:
name: Check
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
- uses: gradle/wrapper-validation-action@v1
- uses: actions/setup-java@v1
with:
java-version: 11
- uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: gradle-${{ runner.os }}-${{ hashFiles('**/**.gradle.kts', '**/gradle/wrapper/gradle-wrapper.properties') }}
- name: Check style
run: ./gradlew ktlintCheck
# Check if there has been a binary incompatible change to the API.
# If this change is intentional, run `./gradlew apiDump` and commit the new API files.
- name: Check binary compatibility
run: ./gradlew apiCheck
instrumentation-tests:
name: Instrumentation tests
runs-on: macOS-latest
timeout-minutes: 60
strategy:
fail-fast: true
matrix:
api-level: [16, 19, 21, 25]
steps:
- uses: actions/checkout@v2
- uses: gradle/wrapper-validation-action@v1
- uses: actions/setup-java@v1
with:
java-version: 11
- uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: gradle-${{ runner.os }}-${{ hashFiles('**/**.gradle.kts', '**/gradle/wrapper/gradle-wrapper.properties') }}
- name: Instrumentation tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
arch: x86
script: ./gradlew connectedDebugAndroidTest --exclude-task :location:connectedDebugAndroidTest
instrumentation-tests-with-google-play-services:
name: Instrumentation tests
runs-on: macOS-latest
timeout-minutes: 60
strategy:
fail-fast: true
matrix:
api-level: [29]
target: [playstore]
steps:
- uses: actions/checkout@v2
- uses: gradle/wrapper-validation-action@v1
- uses: actions/setup-java@v1
with:
java-version: 11
- uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: gradle-${{ runner.os }}-${{ hashFiles('**/**.gradle.kts', '**/gradle/wrapper/gradle-wrapper.properties') }}
- name: Instrumentation tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
target: ${{ matrix.target }}
arch: x86
script: ./gradlew connectedDebugAndroidTest
deploy-snapshot:
name: Deploy snapshot
runs-on: ubuntu-latest
timeout-minutes: 10
if: github.ref == 'refs/heads/master'
needs: [ check, instrumentation-tests, instrumentation-tests-with-google-play-services ]
steps:
- uses: actions/checkout@v2
- uses: gradle/wrapper-validation-action@v1
- uses: actions/setup-java@v1
with:
java-version: 11
- uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: gradle-${{ runner.os }}-${{ hashFiles('**/**.gradle.kts', '**/gradle/wrapper/gradle-wrapper.properties') }}
- name: Deploy Snapshot
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
run: ./publish_remote.sh