chore: Adds CODEOWNERS file to define default code owners (EVOLV-4) #2778
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: | |
pull_request: | |
types: [opened, synchronize] # Don't rerun on `edited` to save time | |
jobs: | |
unit-test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
module: [messagingpush, messaginginapp, base, datapipelines, core, tracking-migration] | |
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@v4 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_UPLOAD_TOKEN }} | |
with: | |
fail_ci_if_error: true | |
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: ubuntu-latest | |
timeout-minutes: 45 | |
strategy: | |
fail-fast: false | |
matrix: | |
sample: [kotlin_compose, java_layout] | |
api-level: [31] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/setup-android | |
- name: Gradle cache | |
uses: gradle/actions/setup-gradle@v4 | |
continue-on-error: true | |
timeout-minutes: 5 | |
with: | |
cache-overwrite-existing: true | |
gradle-home-cache-cleanup: true | |
- name: Enable KVM | |
run: | | |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules | |
sudo udevadm control --reload-rules | |
sudo udevadm trigger --name-match=kvm | |
# Create and cache the AVD | |
- name: AVD cache | |
uses: actions/cache@v4 | |
id: avd-cache | |
with: | |
path: | | |
~/.android/avd/* | |
~/.android/adb* | |
key: avd-${{ matrix.api-level }} | |
# Create AVD and generate snapshot for caching | |
- name: Create AVD and generate snapshot | |
if: steps.avd-cache.outputs.cache-hit != 'true' | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: ${{ matrix.api-level }} | |
arch: x86_64 | |
target: google_apis | |
ram-size: 4096M | |
force-avd-creation: false | |
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | |
disable-animations: false | |
script: echo "Generated AVD snapshot for caching." | |
# Run the actual tests | |
- name: Run instrumentation tests | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: ${{ matrix.api-level }} | |
arch: x86_64 | |
target: google_apis | |
ram-size: 4096M | |
force-avd-creation: false | |
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | |
disable-animations: true | |
# Run the instrumentation tests on the emulator. | |
script: ./gradlew :samples:${{ matrix.sample }}:connectedDebugAndroidTest --no-daemon --stacktrace -PuseKsp=true | |
- 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' |