Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ci and fix for native engines #6

Merged
merged 2 commits into from
Sep 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: 'Tests'

on:
pull_request:
push:
branches:
- main

jobs:
test-jvm:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Run tests
run: ./gradlew jvmTest

- name: Test Report
uses: mikepenz/action-junit-report@v4
if: success() || failure()
with:
check_name: 'JVM Test Reports'
report_paths: '**/build/test-results/jvmTest/TEST-*.xml'

test-linux:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install libcurl
run: sudo apt-get install -y libcurl4-gnutls-dev

- name: Run tests
run: ./gradlew nativeTest

- name: Test Report
uses: mikepenz/action-junit-report@v4
if: success() || failure()
with:
check_name: 'Linux Test Reports'
report_paths: '**/build/test-results/nativeTest/TEST-*.xml'

test-darwin:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Run tests
run: ./gradlew nativeTest

- name: Test Report
uses: mikepenz/action-junit-report@v4
if: success() || failure()
with:
check_name: 'Darwin Test Reports'
report_paths: '**/build/test-results/nativeTest/TEST-*.xml'

test-mingw:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Run tests
run: ./gradlew nativeTest

- name: Test Report
uses: mikepenz/action-junit-report@v4
if: success() || failure()
with:
check_name: 'Mingw Test Reports'
report_paths: '**/build/test-results/nativeTest/TEST-*.xml'
9 changes: 7 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ kotlin {
when {
hostOs == "Mac OS X" && isArm64 -> macosArm64("native")
hostOs == "Mac OS X" && !isArm64 -> macosX64("native")
hostOs == "Linux" && isArm64 -> linuxArm64("native")
hostOs == "Linux" && !isArm64 -> linuxX64("native")
isMingwX64 -> mingwX64("native")
else -> throw GradleException("Host OS is not supported in Kotlin/Native.")
Expand Down Expand Up @@ -58,7 +57,13 @@ kotlin {
val jvmTest by getting
val nativeMain by getting {
dependencies {
implementation("io.ktor:ktor-client-darwin:$ktorVersion")
when {
hostOs == "Mac OS X" -> implementation("io.ktor:ktor-client-darwin:$ktorVersion")
hostOs == "Linux"-> implementation("io.ktor:ktor-client-curl:$ktorVersion")
isMingwX64 -> implementation("io.ktor:ktor-client-winhttp:$ktorVersion")
else -> throw GradleException("Host OS is not supported in Kotlin/Native.")
}

}
}
val nativeTest by getting
Expand Down