generated from vextorspace/KotlinMultiplatformTesting
-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (50 loc) · 1.6 KB
/
main.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
name: Test GitHub Runners
on: push
jobs:
build-and-test:
name: Kotlin Multiplatform Project Build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '21'
- name: Build Project
run: ./gradlew assemble
- name: Setup Xvfb on screen 0
run: Xvfb :1 -screen 0 1024x768x24 &
- name: Run Desktop Tests
run: ./gradlew composeApp:desktopTest
env:
DISPLAY: :1
- name: Run Android Unit Tests
run: ./gradlew composeApp:testDebugUnitTest
env:
DISPLAY: :1
- name: Enable KVM group perms
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
- name: Run Android Emulator Tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 30
script: ./gradlew connectedAndroidTest
arch: x86_64
- name: Shutdown Xvfb
run: killall Xvfb
- name: Create Test Summary
uses: test-summary/action@v2
with:
paths: '**/*est-results/**/*.xml'
show: "pass, fail, skip"
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v4
with:
name: desktop-test-report
path: composeApp/build/reports/tests/desktopTest