Megalinter support #57
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 KMP (Android + iOS) | |
| on: | |
| push: | |
| branches: [master] | |
| pull_request: | |
| branches: [master] | |
| workflow_dispatch: | |
| inputs: | |
| run_ios: | |
| description: "Rodar build iOS?" | |
| required: true | |
| default: "false" | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| jobs: | |
| build-android: | |
| name: Build Android (Linux) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup JDK | |
| uses: actions/setup-java@v3 | |
| with: | |
| distribution: "temurin" | |
| java-version: 17 | |
| - name: Grant permission to gradlew | |
| run: chmod +x ./gradlew | |
| - name: Cache Gradle | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
| restore-keys: gradle-${{ runner.os }}- | |
| - name: Build Android (composeApp) | |
| run: ./gradlew :composeApp:assembleDebug | |
| - name: Run Android/CommonMain unit tests | |
| run: ./gradlew testDebugUnitTest | |
| - name: Run Coverage | |
| run: ./gradlew testDebugUnitTest koverHtmlReport | |
| - name: Upload GitHub Pages artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: build/reports/kover/html | |
| build-ios: | |
| if: ${{ github.event.inputs.run_ios == 'true' }} | |
| name: Build iOS (macOS) | |
| runs-on: macos-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup JDK | |
| uses: actions/setup-java@v3 | |
| with: | |
| distribution: 'temurin' | |
| java-version: 17 | |
| - name: Grant permission to gradlew | |
| run: chmod +x ./gradlew | |
| - name: Cache Gradle | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
| restore-keys: gradle-${{ runner.os }}- | |
| - name: Build iOS (KMP Kotlin/Native) | |
| run: ./gradlew :composeApp:compileKotlinIosArm64 | |
| - name: Build iosApp via Xcode | |
| run: | | |
| xcodebuild \ | |
| -project iosApp/iosApp.xcodeproj \ | |
| -scheme iosApp \ | |
| -sdk iphonesimulator \ | |
| -configuration Debug \ | |
| build | |
| - name: Run iOS/CommonMain unit tests | |
| run: ./gradlew iosSimulatorArm64Test |