Skip to content

Commit 197ad5e

Browse files
committed
Add daily tests on phone and car devices
1 parent fbc32e8 commit 197ad5e

File tree

3 files changed

+114
-233
lines changed

3 files changed

+114
-233
lines changed

.github/workflows/daily.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Daily Instrumentation Tests
2+
3+
on:
4+
schedule:
5+
# Run daily at 09:45 UTC
6+
- cron: '45 9 * * *'
7+
workflow_dispatch: # Allow manual triggering
8+
9+
jobs:
10+
instrumented-test:
11+
name: Run Instrumentation Tests
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
include:
16+
- device: phone
17+
profile: Nexus 6
18+
- device: automotive
19+
profile: automotive_1024p_landscape
20+
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@v4
24+
25+
- name: Set up JDK 17
26+
uses: actions/setup-java@v4
27+
with:
28+
distribution: temurin
29+
java-version: 17
30+
31+
- name: Cache Gradle
32+
uses: actions/cache@v4
33+
with:
34+
path: |
35+
~/.gradle/caches
36+
~/.gradle/wrapper
37+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
38+
restore-keys: |
39+
${{ runner.os }}-gradle-
40+
41+
- name: Grant execute permission for Gradle wrapper
42+
run: chmod +x gradlew
43+
44+
- name: Enable KVM group permissions
45+
run: |
46+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
47+
sudo udevadm control --reload-rules
48+
sudo udevadm trigger --name-match=kvm
49+
50+
- name: Run instrumentation tests on ${{ matrix.device }}
51+
uses: reactivecircus/android-emulator-runner@v2
52+
with:
53+
api-level: 29
54+
target: default
55+
arch: x86_64
56+
profile: ${{ matrix.profile }}
57+
script: ./gradlew :openmapview:connectedDebugAndroidTest --continue
58+
59+
- name: Upload test results
60+
if: always()
61+
uses: actions/upload-artifact@v4
62+
with:
63+
name: instrumentation-test-results-${{ matrix.device }}
64+
path: '**/build/outputs/androidTest-results/connected/**/*.xml'
65+
retention-days: 30
66+
67+
- name: Upload test reports
68+
if: always()
69+
uses: actions/upload-artifact@v4
70+
with:
71+
name: instrumentation-test-reports-${{ matrix.device }}
72+
path: '**/build/reports/androidTests/connected/**'
73+
retention-days: 30

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
[![Build Status](https://github.com/afarber/OpenMapView/actions/workflows/ci.yml/badge.svg)](https://github.com/afarber/OpenMapView/actions/workflows/ci.yml)
1+
[![CI](https://github.com/afarber/OpenMapView/actions/workflows/ci.yml/badge.svg)](https://github.com/afarber/OpenMapView/actions/workflows/ci.yml)
2+
[![Daily Tests](https://github.com/afarber/OpenMapView/actions/workflows/daily.yml/badge.svg)](https://github.com/afarber/OpenMapView/actions/workflows/daily.yml)
3+
[![Release](https://github.com/afarber/OpenMapView/actions/workflows/release.yml/badge.svg)](https://github.com/afarber/OpenMapView/actions/workflows/release.yml)
24

35
# OpenMapView
46

@@ -40,7 +42,7 @@ Demonstrates marker system with custom icons and click handling.
4042
- [Maven Central Setup](docs/MAVEN_CENTRAL_SETUP.md) - Publishing configuration and release process
4143
- [GitHub Workflows](docs/GITHUB_WORKFLOWS.md) - CI/CD pipeline and workflow architecture
4244
- [Unit Testing](docs/TESTING_UNIT.md) - JVM unit tests with Robolectric for Android framework APIs
43-
- [Instrumented Testing](docs/TESTING_INSTRUMENTED.md) - On-device testing guide (not yet implemented)
45+
- [Instrumented Testing](docs/TESTING_INSTRUMENTED.md) - On-device (phone and auto) testing with Android emulator
4446

4547
## Getting Started
4648

0 commit comments

Comments
 (0)