-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (54 loc) · 2.08 KB
/
check.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
name: check
on:
push:
env:
GRADLEW_ARGUMENTS: "--console=plain --stacktrace -Pci -Pcoverage"
jobs:
build_and_test:
runs-on: macos-latest
steps:
# https://github.com/marketplace/actions/checkout
- name: Checkout code
uses: actions/checkout@v3
# https://github.com/marketplace/actions/gradle-wrapper-validation
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
# https://github.com/marketplace/actions/setup-java-jdk
- name: Setup JDK 17
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
- name: Setup Gradle
run: ./gradlew --version
- name: Check public API
run: ./gradlew dabirva:apiCheck $GRADLEW_ARGUMENTS
- name: Run Android lint
run: ./gradlew dabirva:lintDebug $GRADLEW_ARGUMENTS
- name: Print Android lint results
run: cat ./dabirva/build/reports/lint-results-debug.xml
- name: Run unit tests with coverage
run: ./gradlew dabirva:testDebugUnitTest $GRADLEW_ARGUMENTS
# https://github.com/marketplace/actions/android-emulator-runner
- name: Run instrumented tests with coverage
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 33
target: google_apis
arch: x86_64
script: ./gradlew example:connectedDebugAndroidTest $GRADLEW_ARGUMENTS
- name: Merge test coverage reports
run: ./gradlew jacocoMergedReportDebug $GRADLEW_ARGUMENTS
# https://github.com/marketplace/actions/surefire-report
- name: Publish test results to GitHub
uses: scacap/action-surefire-report@v1
if: ${{ always() }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
report_paths: ./*/build/test-results/**/*.xml
# https://github.com/marketplace/actions/codecov
- name: Publish test coverage to codecov
uses: codecov/codecov-action@v3
with:
directory: ./build/reports/jacoco/jacocoMergedReportDebug
fail_ci_if_error: true