Skip to content

Commit

Permalink
Add emulator API 24 & error artifact report uploads
Browse files Browse the repository at this point in the history
  • Loading branch information
05nelsonm committed Oct 24, 2024
1 parent bdad09f commit c4f3d89
Showing 1 changed file with 33 additions and 40 deletions.
73 changes: 33 additions & 40 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -1,49 +1,26 @@
name: Test
name: CI

on: [ pull_request ]

env:
GRADLE_OPTS: -Dorg.gradle.daemon=false -Dkotlin.incremental=false -Dorg.gradle.jvmargs="-XX:+HeapDumpOnOutOfMemoryError -XX:MetaspaceSize=1g"

jobs:
build:
check:
strategy:
fail-fast: false
matrix:
os: [ macos-latest, ubuntu-latest, ubuntu-20.04, windows-latest, windows-2019 ]

runs-on: ${{ matrix.os }}

steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Checkout Repository
uses: actions/checkout@v4

- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1

- name: Setup Caches [ Gradle Wrapper ]
uses: actions/cache@v1
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.*') }}
restore-keys: ${{ runner.os }}-gradle-wrapper-

- name: Setup Caches [ Konan ]
uses: actions/cache@v1
with:
path: ~/.konan
key: ${{ runner.os }}-konan-${{ hashFiles('**/*.gradle.kts') }}-${{ hashFiles('gradle/libs.versions.toml') }}
restore-keys: ${{ runner.os }}-konan-

- name: Setup Caches [ Gradle Caches ]
uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: ${{ matrix.os }}-gradle-caches-${{ hashFiles('**/*.gradle.kts') }}-${{ hashFiles('gradle/libs.versions.toml') }}
restore-keys: ${{ matrix.os }}-gradle-caches-
uses: gradle/actions/wrapper-validation@v3

- name: Setup JDK
uses: actions/setup-java@v3.4.0
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17
Expand All @@ -53,37 +30,48 @@ jobs:
run: >
./gradlew check --stacktrace
-PKMP_TARGETS="JVM,JS,IOS_ARM64,IOS_X64,IOS_SIMULATOR_ARM64,MACOS_ARM64,MACOS_X64,TVOS_ARM64,TVOS_X64,TVOS_SIMULATOR_ARM64,WATCHOS_ARM32,WATCHOS_ARM64,WATCHOS_DEVICE_ARM64,WATCHOS_X64,WATCHOS_SIMULATOR_ARM64,WASM_JS,WASM_WASI"
- name: Run Linux Tests
if: matrix.os == 'ubuntu-latest'
run: >
./gradlew check --stacktrace
-PKMP_TARGETS="JVM,JS,ANDROID,ANDROID_ARM32,ANDROID_ARM64,ANDROID_X64,ANDROID_X86,LINUX_ARM64,LINUX_X64,WASM_JS,WASM_WASI"
- name: Run Linux JVM Tests
if: matrix.os == 'ubuntu-20.04'
run: >
./gradlew check --stacktrace
-PKMP_TARGETS="JVM"
- name: Run Windows Tests
if: matrix.os == 'windows-latest'
run: >
./gradlew check --stacktrace
-PKMP_TARGETS="JVM,JS,MINGW_X64,WASM_JS,WASM_WASI"
- name: Run Windows JVM Tests
if: matrix.os == 'windows-2019'
run: >
./gradlew check --stacktrace
-PKMP_TARGETS="JVM"
emulator:
runs-on: ubuntu-latest
- name: Upload Test Reports
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: test-report-${{ matrix.os }}
path: '**/build/reports/tests/**'
retention-days: 1

android-check:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
api-level: [ 21, 23, 26, 29 ]
api-level: [ 21, 23, 24, 26, 29 ]
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Checkout Repository
uses: actions/checkout@v4

- name: Enable KVM
run: |
Expand All @@ -92,20 +80,25 @@ jobs:
sudo udevadm trigger --name-match=kvm
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
uses: gradle/actions/wrapper-validation@v3

- name: Setup JDK
uses: actions/setup-java@v3.11.0
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17

- name: Build
uses: gradle/gradle-build-action@v2

- name: Run Android Instrumented Tests
uses: reactivecircus/android-emulator-runner@v2
with:
emulator-boot-timeout: 300 # 5 minutes
api-level: ${{ matrix.api-level }}
script: ./gradlew :library:driver-test:connectedCheck -PKMP_TARGETS="ANDROID,JVM"
script: ./gradlew connectedCheck -PKMP_TARGETS="ANDROID,JVM"

- name: Upload Test Reports
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: test-report-android-${{ matrix.api-level }}
path: '**/build/reports/androidTests/**'
retention-days: 1

0 comments on commit c4f3d89

Please sign in to comment.