From ff2ed1da8214a563a9055ecacaed77b3d41ed34c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Karmaz=C3=ADn?= Date: Fri, 20 Sep 2024 15:41:37 +0200 Subject: [PATCH] Add Linux, MinGW, WasmWasi targets --- .github/workflows/gradle.yml | 58 ++++++++++++++++++++++++++++++++++++ escpos4k/build.gradle.kts | 9 ++++-- gradle/libs.versions.toml | 3 +- 3 files changed, 67 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/gradle.yml diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml new file mode 100644 index 0000000..e1e3fc7 --- /dev/null +++ b/.github/workflows/gradle.yml @@ -0,0 +1,58 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. +# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle + +name: Java CI with Gradle + +on: + push: + branches: [ "main", "github-ci" ] + pull_request: + branches: [ "main" ] + workflow_call: + +permissions: + contents: read + +jobs: + build: + strategy: + matrix: + include: + - target: iosSimulatorArm64Test + os: macos-latest + - target: jvmTest + os: ubuntu-latest + - target: linuxX64Test + os: ubuntu-latest + - target: mingwX64Test + os: windows-latest + - target: wasmWasiTest + os: ubuntu-latest + - target: testDebugUnitTest + os: ubuntu-latest + - target: testReleaseUnitTest + os: ubuntu-latest + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v3 + - name: Validate Gradle Wrapper + uses: gradle/wrapper-validation-action@v1 + - uses: actions/cache@v3 + with: + path: | + ~/.konan + key: ${{ runner.os }}-${{ hashFiles('**/.lock') }} + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + - name: Build with Gradle + uses: gradle/gradle-build-action@ce999babab2de1c4b649dc15f0ee67e6246c994f + with: + arguments: ${{ matrix.target }} diff --git a/escpos4k/build.gradle.kts b/escpos4k/build.gradle.kts index cf779fe..97f5f4a 100644 --- a/escpos4k/build.gradle.kts +++ b/escpos4k/build.gradle.kts @@ -60,6 +60,11 @@ kotlin { macosArm64() macosX64() + linuxArm64() + linuxX64() + mingwX64() + wasmWasi() + sourceSets { val commonMain by getting { dependencies { @@ -81,13 +86,13 @@ kotlin { val androidMain by getting val androidUnitTest by getting { dependencies { - implementation(libs.kotlin.test.junit) + implementation(libs.kotlin.test.junit5) implementation(libs.kotest.runner.junit5) } } val jvmTest by getting { dependencies { - implementation(libs.kotlin.test.junit) + implementation(libs.kotlin.test.junit5) implementation(libs.kotest.runner.junit5) } } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 4a6eb93..ae24fb5 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -4,7 +4,7 @@ androidCoreDesugaring = "2.0.3" androidGradlePlugin = "8.2.0" androidMinSdk = "23" androidTargetSdk = "33" -arrow = "1.2.1" +arrow = "1.2.4" coroutines = "1.7.3" dependencyUpdates = "0.50.0" kotest = "5.9.0" @@ -30,6 +30,7 @@ kotlin-test-common-annotations = { module = "org.jetbrains.kotlin:kotlin-test-an kotlin-test-common-assertions = { module = "org.jetbrains.kotlin:kotlin-test-common", version.ref = "kotlin" } kotlin-test-junit = { module = "org.jetbrains.kotlin:kotlin-test-junit", version.ref = "kotlin" } kotlin-test-junit5 = { module = "org.jetbrains.kotlin:kotlin-test-junit5", version.ref = "kotlin" } +kotlin-test-js = { module = "org.jetbrains.kotlin:kotlin-test-js", version.ref = "kotlin" } kotlinx-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "coroutines" } kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutines" }