mirror of
https://github.com/vide/matedroid.git
synced 2026-01-20 00:03:17 +08:00
4f5d868019
- Add stopAutoRefresh() method to DashboardViewModel for testability - Fix tests to use advanceTimeBy() + runCurrent() instead of advanceUntilIdle() to avoid infinite loop from auto-refresh job - Add GitHub Actions workflow to run tests on PRs to main Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
35 lines
688 B
YAML
35 lines
688 B
YAML
name: Run Tests
|
|
|
|
on:
|
|
pull_request:
|
|
branches: [main]
|
|
push:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up JDK 17
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
java-version: '17'
|
|
distribution: 'temurin'
|
|
|
|
- name: Setup Gradle
|
|
uses: gradle/actions/setup-gradle@v4
|
|
|
|
- name: Run unit tests
|
|
run: ./gradlew testDebugUnitTest
|
|
|
|
- name: Upload test results
|
|
if: always()
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: test-results
|
|
path: app/build/reports/tests/testDebugUnitTest/
|