added support for unity #1800
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
- name: Set up JDK | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'adopt' | |
java-version: '11' # Robolectric requires v9, but we choose LTS: https://adoptopenjdk.net/ | |
- name: Setup Android SDK | |
uses: android-actions/setup-android@v2 | |
- 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 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'adopt' | |
java-version: '17' | |
- name: Setup Android SDK | |
uses: android-actions/setup-android@v2 | |
- name: Gradle cache | |
uses: gradle/gradle-build-action@v2 | |
- 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' |