-
Notifications
You must be signed in to change notification settings - Fork 9
62 lines (59 loc) · 2.54 KB
/
test.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
name: Tests
on: [push, pull_request]
jobs:
unit-test:
runs-on: ubuntu-latest
strategy:
matrix:
module: [sdk, messagingpush, messaginginapp, base]
name: Unit tests (${{ matrix.module }})
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-android
- name: Run unit tests (${{ matrix.module }})
run: ./gradlew :${{ matrix.module }}:runJacocoTestReport
- name: Upload code coverage report
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_UPLOAD_TOKEN }} # not required for public repos, but sometimes uploads fail without it so include it anyway
fail_ci_if_error: true # fail if upload fails so we can catch it and fix it right away.
verbose: true
files: ./${{ matrix.module }}/build/reports/jacoco/test/jacocoTestReport.xml,./${{ matrix.module }}/build/reports/jacoco/runJacocoTestReport/runJacocoTestReport.xml
- name: Publish test results (${{ matrix.module }})
uses: mikepenz/action-junit-report@v4
with:
report_paths: '**/build/test-results/test*/TEST-*.xml'
fail_on_failure: true
require_tests: true
if: ${{ always() }} # if running tests fails, we still want to parse the test results
instrumentation-test:
runs-on: macos-latest
timeout-minutes: 45
strategy:
# Add more samples here as they are added to the project.
matrix:
sample: [kotlin_compose, java_layout]
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-android
- name: Start emulator
uses: reactivecircus/android-emulator-runner@v2
with:
# Configuration options for the emulator for the best optimization.
api-level: 29
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
ram-size: 4096M
emulator-boot-timeout: 12000
target: default
arch: x86
emulator-build: 7425822 # https://github.com/ReactiveCircus/android-emulator-runner/issues/160
profile: Nexus 6
# Run the instrumentation tests on the emulator.
script: ./gradlew :samples:${{ matrix.sample }}:connectedDebugAndroidTest
- name: Publish test results
uses: mikepenz/action-junit-report@v4
if: always()
with:
report_paths: 'samples/${{ matrix.sample }}/build/outputs/androidTest-results/connected/TEST-*.xml'