Create Cross-Platform Compose UI Tests #4
Workflow file for this run
This file contains hidden or 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: Multiplatform Tests | |
| on: | |
| pull_request: | |
| push: | |
| branches: [ main, master ] | |
| # Cancel any current or previous job from the same PR | |
| concurrency: | |
| group: multiplatform-tests-${{ github.head_ref || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| # JVM/Desktop tests (fastest, most reliable) | |
| jvm-tests: | |
| name: JVM Tests | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: 'zulu' | |
| java-version: 17 | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| - name: Run Common JVM Tests | |
| run: ./gradlew :common:jvmTest --no-daemon --stacktrace | |
| - name: Upload Test Results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: jvm-test-results | |
| path: common/build/reports/tests/jvmTest/ | |
| # Android Unit Tests (Robolectric) | |
| android-tests: | |
| name: Android Tests | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: 'zulu' | |
| java-version: 17 | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| - name: Run Common Android Tests | |
| run: ./gradlew :common:testDebugUnitTest --no-daemon --stacktrace | |
| - name: Upload Test Results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: android-test-results | |
| path: common/build/reports/tests/testDebugUnitTest/ | |
| # iOS Tests (requires macOS) | |
| ios-tests: | |
| name: iOS Tests | |
| runs-on: macos-14 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: 'zulu' | |
| java-version: 17 | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| - name: Run iOS Simulator Arm64 Tests | |
| run: ./gradlew :common:iosSimulatorArm64Test --no-daemon --stacktrace | |
| - name: Upload Test Results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ios-test-results | |
| path: common/build/reports/tests/iosSimulatorArm64Test/ | |
| # WebAssembly Tests | |
| wasm-tests: | |
| name: WebAssembly Tests | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: 'zulu' | |
| java-version: 17 | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| - name: kotlinUpgradeYarnLock | |
| run: ./gradlew kotlinUpgradeYarnLock | |
| - name: Run WebAssembly Tests | |
| run: ./gradlew :common:wasmJsTest --no-daemon --stacktrace | |
| - name: Upload Test Results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: wasm-test-results | |
| path: common/build/reports/tests/wasmJsTest/ | |
| # Summary job that requires all tests to pass | |
| test-summary: | |
| name: Test Summary | |
| runs-on: ubuntu-24.04 | |
| needs: [jvm-tests, android-tests, ios-tests, wasm-tests] | |
| if: always() | |
| steps: | |
| - name: Check test results | |
| run: | | |
| echo "JVM Tests: ${{ needs.jvm-tests.result }}" | |
| echo "Android Tests: ${{ needs.android-tests.result }}" | |
| echo "iOS Tests: ${{ needs.ios-tests.result }}" | |
| echo "WASM Tests: ${{ needs.wasm-tests.result }}" | |
| if [ "${{ needs.jvm-tests.result }}" != "success" ] || \ | |
| [ "${{ needs.android-tests.result }}" != "success" ] || \ | |
| [ "${{ needs.ios-tests.result }}" != "success" ] || \ | |
| [ "${{ needs.wasm-tests.result }}" != "success" ]; then | |
| echo "One or more test suites failed" | |
| exit 1 | |
| fi | |
| echo "All tests passed successfully!" |