Skip to content

Update kmm-rust.yml

Update kmm-rust.yml #2

Workflow file for this run

name: Kotlin Multiplatform CI
on: [push, pull_request]
jobs:
build-and-test:
runs-on: ubuntu-latest
strategy:
matrix:
platform: [android, ios]
steps:
- uses: actions/checkout@v2
# Setup JDK for Kotlin
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
# Cache dependencies
- name: Cache Gradle dependencies
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
# Conditional steps for platform
- name: Build Android
if: matrix.platform == 'android'
run: ./gradlew assembleDebug
- name: Build iOS
if: matrix.platform == 'ios'
run: |
sudo xcode-select -s /Applications/Xcode_12.4.app
./gradlew build -PiosTarget
- name: Run common tests
run: ./gradlew commonTest
- name: Run Android tests
if: matrix.platform == 'android'
run: ./gradlew connectedCheck
- name: Run iOS tests
if: matrix.platform == 'ios'
run: ./gradlew iosTest