Skip to content

Commit

Permalink
Run tests for KSP and K2 mode
Browse files Browse the repository at this point in the history
  • Loading branch information
rickclephas committed Jul 27, 2024
1 parent 7115555 commit 6c70ad5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/run-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ jobs:
- name: Run tests
env:
GRADLE_MODULE: ${{ format(':kmp-nativecoroutines-{0}', matrix.module) }}
run: ./gradlew $GRADLE_MODULE:check
IS_COMPILER_MODULE: ${{ matrix.module == 'compiler' }}
run: ./gradlew $GRADLE_MODULE:check -PbuildForCompilerTest=$IS_COMPILER_MODULE
- name: Archive reports
if: failure()
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -115,7 +116,8 @@ jobs:
matrix:
platform: [ iOS, macOS, tvOS, watchOS ]
embeddable-compiler: [ true, false ]
name: ${{ format('Sample {0} (embeddable {1})', matrix.platform, matrix.embeddable-compiler) }}
ksp-mode: [ true, false ]
name: ${{ format('Sample {0} (embeddable {1}, KSP {2})', matrix.platform, matrix.embeddable-compiler, matrix.kps-mode) }}
runs-on: macos-14
env:
XCODEBUILD_SCHEME_iOS: iOS App
Expand Down Expand Up @@ -153,6 +155,7 @@ jobs:
env:
XCODEBUILD_SCHEME: ${{ env[format('XCODEBUILD_SCHEME_{0}', matrix.platform)] }}
XCODEBUILD_DESTINATION: ${{ env[format('XCODEBUILD_DESTINATION_{0}', matrix.platform)] }}
NATIVE_COROUTINES_KSP_MODE: ${{ matrix.ksp-mode }}
run: >-
xcodebuild test
-project KMPNativeCoroutinesSample.xcodeproj
Expand Down
6 changes: 4 additions & 2 deletions sample/shared/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
plugins {
alias(libs.plugins.kotlin.multiplatform)
alias(libs.plugins.kotlin.plugin.serialization)
alias(libs.plugins.ksp)
if (System.getenv("NATIVE_COROUTINES_KSP_MODE")?.toBooleanStrictOrNull() == true) {
alias(libs.plugins.ksp)
}
id("com.rickclephas.kmp.nativecoroutines")
}

Expand Down Expand Up @@ -51,5 +53,5 @@ kotlin {
}

nativeCoroutines {
k2Mode = true
k2Mode = System.getenv("NATIVE_COROUTINES_KSP_MODE")?.toBooleanStrictOrNull() != true
}

0 comments on commit 6c70ad5

Please sign in to comment.