Add compilation checks for Android, Native, WasmJS, and CLI targets to CI #33
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: Build & Test | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| test: | |
| name: Test - ${{ matrix.platform }} | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 15 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: windows-latest | |
| platform: Windows | |
| - os: macos-latest | |
| platform: macOS | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Validate Gradle wrapper | |
| uses: gradle/actions/wrapper-validation@v4 | |
| - name: Setup JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '21' | |
| distribution: 'temurin' | |
| - name: Grant execute permission | |
| if: runner.os != 'Windows' | |
| run: chmod +x ./gradlew | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| with: | |
| cache-read-only: ${{ github.ref != 'refs/heads/main' }} | |
| add-job-summary: on-failure | |
| - name: Execute JVM tests | |
| run: ${{ runner.os == 'Windows' && '.\gradlew.bat' || './gradlew' }} :library:jvmTest --no-daemon --stacktrace | |
| - name: Execute ComposeApp desktop tests | |
| run: ${{ runner.os == 'Windows' && '.\gradlew.bat' || './gradlew' }} :composeApp:desktopTest --no-daemon --stacktrace | |
| - name: Execute WASM tests | |
| run: ${{ runner.os == 'Windows' && '.\gradlew.bat' || './gradlew' }} :library:wasmJsTest --no-daemon --stacktrace | |
| - name: Publish test report | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-report-${{ matrix.platform }} | |
| path: | | |
| library/build/test-results/jvmTest/ | |
| library/build/reports/tests/jvmTest/ | |
| composeApp/build/test-results/desktopTest/ | |
| composeApp/build/reports/tests/desktopTest/ | |
| library/build/test-results/wasmJsTest/ | |
| library/build/reports/tests/wasmJsTest/ | |
| retention-days: 7 | |
| if-no-files-found: ignore | |
| compile: | |
| name: Compile - ${{ matrix.target }} | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 15 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| target: Android | |
| - os: macos-latest | |
| target: Native | |
| - os: ubuntu-latest | |
| target: WasmJS | |
| - os: ubuntu-latest | |
| target: CLI | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Validate Gradle wrapper | |
| uses: gradle/actions/wrapper-validation@v4 | |
| - name: Setup JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '21' | |
| distribution: 'temurin' | |
| - name: Setup Android SDK | |
| if: matrix.target == 'Android' | |
| run: yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses || true | |
| - name: Grant execute permission | |
| run: chmod +x ./gradlew | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| with: | |
| cache-read-only: ${{ github.ref != 'refs/heads/main' }} | |
| add-job-summary: on-failure | |
| - name: Compile Android targets | |
| if: matrix.target == 'Android' | |
| run: ./gradlew :composeApp:compileDebugKotlinAndroid --no-daemon --stacktrace | |
| - name: Compile Native targets | |
| if: matrix.target == 'Native' | |
| run: ./gradlew :library:compileKotlinIosArm64 :composeApp:compileKotlinIosArm64 --no-daemon --stacktrace | |
| - name: Compile WasmJS targets | |
| if: matrix.target == 'WasmJS' | |
| run: ./gradlew :library:compileKotlinWasmJs :composeApp:compileKotlinWasmJs --no-daemon --stacktrace | |
| - name: Compile CLI | |
| if: matrix.target == 'CLI' | |
| run: ./gradlew :cli:compileKotlin --no-daemon --stacktrace |