2020-05-04 15:29:52 +00:00
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
paths:
|
|
|
|
- '.github/**'
|
|
|
|
- 'app/**'
|
|
|
|
- 'gradle/**'
|
|
|
|
- '*.properties'
|
|
|
|
- '*.gradle'
|
|
|
|
- 'gradlew'
|
|
|
|
- 'gradlew.bat'
|
2019-12-15 21:49:18 +00:00
|
|
|
|
|
|
|
name: Check pull request
|
2019-10-02 05:14:16 +00:00
|
|
|
jobs:
|
2019-12-15 21:49:18 +00:00
|
|
|
test-pr:
|
2020-04-16 18:54:13 +00:00
|
|
|
runs-on: macos-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2020-04-18 18:16:40 +00:00
|
|
|
api-level: [23, 29]
|
|
|
|
variant: [Debug, Release]
|
2019-10-02 05:14:16 +00:00
|
|
|
steps:
|
2019-12-31 15:27:38 +00:00
|
|
|
|
2019-10-02 05:14:16 +00:00
|
|
|
- uses: actions/checkout@master
|
2019-12-31 15:27:38 +00:00
|
|
|
|
2020-02-25 09:52:05 +00:00
|
|
|
- name: Copy CI gradle.properties
|
|
|
|
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
|
|
|
|
|
2020-05-01 09:50:57 +00:00
|
|
|
- name: Generate cache key
|
|
|
|
run: ./.github/checksum.sh checksum.txt
|
|
|
|
|
|
|
|
- name: Cache gradle modules
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: ~/.gradle/caches/modules-2
|
|
|
|
key: ${{ runner.os }}-gradlemodules-${{ hashFiles('checksum.txt') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-gradlemodules-
|
|
|
|
|
|
|
|
- name: Cache gradle jars
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: ~/.gradle/caches/jars-3
|
|
|
|
key: ${{ runner.os }}-gradlejars-${{ hashFiles('checksum.txt') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-gradlejars-
|
|
|
|
|
|
|
|
- name: Cache gradle build
|
|
|
|
uses: actions/cache@v1
|
2019-12-31 15:27:38 +00:00
|
|
|
with:
|
2020-05-01 09:50:57 +00:00
|
|
|
path: ~/.gradle/caches/build-cache-1
|
|
|
|
key: ${{ runner.os }}-gradlebuildcache-${{ hashFiles('checksum.txt') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-gradlebuildcache-
|
2019-12-31 15:27:38 +00:00
|
|
|
|
2020-04-16 18:54:13 +00:00
|
|
|
- name: Run unit tests
|
2020-04-18 18:16:40 +00:00
|
|
|
run: ./gradlew spotlessCheck test${{ matrix.variant }} lint${{ matrix.variant}} -Dpre-dex=false
|
2019-12-31 15:27:38 +00:00
|
|
|
|
2020-04-16 18:54:13 +00:00
|
|
|
- name: Run instrumentation tests
|
|
|
|
uses: reactivecircus/android-emulator-runner@v2
|
2019-10-02 05:14:16 +00:00
|
|
|
with:
|
2020-04-16 18:54:13 +00:00
|
|
|
api-level: ${{ matrix.api-level }}
|
|
|
|
target: default
|
|
|
|
script: ./gradlew connectedCheck
|