From 2aa5fcdb9550eead2bf20bed99e7674b70400f99 Mon Sep 17 00:00:00 2001 From: hfhbd Date: Tue, 31 Oct 2023 15:24:34 +0100 Subject: [PATCH 1/2] CI: use config cache and test on macOS --- .github/workflows/CD.yml | 4 +-- .github/workflows/CI.yml | 4 +-- .github/workflows/Docs.yml | 4 +-- gradle.properties | 2 ++ .../src/main/kotlin/kotlinMPP.gradle.kts | 32 +++++++++++++++++++ kotlinx-uuid-core/build.gradle.kts | 32 ------------------- kotlinx-uuid-exposed/build.gradle.kts | 2 +- kotlinx-uuid-sqldelight/build.gradle.kts | 32 ------------------- settings.gradle.kts | 1 + 9 files changed, 41 insertions(+), 72 deletions(-) diff --git a/.github/workflows/CD.yml b/.github/workflows/CD.yml index e772685..693783a 100644 --- a/.github/workflows/CD.yml +++ b/.github/workflows/CD.yml @@ -9,7 +9,7 @@ concurrency: cancel-in-progress: false env: - GRADLE_OPTS: -Dorg.gradle.parallel=true -Dorg.gradle.caching=true + GRADLE_OPTS: -Dorg.gradle.caching=true jobs: build: @@ -27,8 +27,6 @@ jobs: distribution: 'adopt' java-version: 11 - uses: gradle/gradle-build-action@v2 - - name: Build with Gradle - run: ./gradlew build - name: Publish run: ./gradlew -Pversion=$version -Dorg.gradle.parallel=false publish closeAndReleaseStagingRepository env: diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index cb5d16c..66d2802 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -7,11 +7,11 @@ on: branches: [ main ] env: - GRADLE_OPTS: -Dorg.gradle.parallel=true -Dorg.gradle.caching=true + GRADLE_OPTS: -Dorg.gradle.caching=true jobs: build: - runs-on: ubuntu-latest + runs-on: macos-latest permissions: contents: write security-events: write diff --git a/.github/workflows/Docs.yml b/.github/workflows/Docs.yml index d05fffe..c0f8c8a 100644 --- a/.github/workflows/Docs.yml +++ b/.github/workflows/Docs.yml @@ -6,7 +6,7 @@ on: workflow_dispatch: env: - GRADLE_OPTS: -Dorg.gradle.parallel=true -Dorg.gradle.caching=true + GRADLE_OPTS: -Dorg.gradle.caching=true jobs: build: @@ -32,4 +32,4 @@ jobs: path: build/dokka/htmlMultiModule - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@main + uses: actions/deploy-pages@v2 diff --git a/gradle.properties b/gradle.properties index d2c1954..ab8601a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,6 +4,8 @@ # kotlin.code.style=official org.gradle.parallel=true +org.gradle.configuration-cache=true +org.gradle.configureondemand=true kotlin.native.ignoreDisabledTargets=true org.gradle.jvmargs=-XX:MaxMetaspaceSize=1g group=app.softwork diff --git a/gradle/build-logic/src/main/kotlin/kotlinMPP.gradle.kts b/gradle/build-logic/src/main/kotlin/kotlinMPP.gradle.kts index dddb9cb..0985024 100644 --- a/gradle/build-logic/src/main/kotlin/kotlinMPP.gradle.kts +++ b/gradle/build-logic/src/main/kotlin/kotlinMPP.gradle.kts @@ -7,5 +7,37 @@ plugins { plugins.apply("org.jetbrains.kotlin.multiplatform") extensions.configure("kotlin") { + jvm() + js(IR) { + browser() + nodejs() + } + + // tier 1 + linuxX64() + macosX64() + macosArm64() + iosSimulatorArm64() + iosX64() + + // tier 2 + linuxArm64() + watchosSimulatorArm64() + watchosX64() + watchosArm32() + watchosArm64() + tvosSimulatorArm64() + tvosX64() + tvosArm64() + iosArm64() + + // tier 3 + androidNativeArm32() + androidNativeArm64() + androidNativeX86() + androidNativeX64() + mingwX64() + watchosDeviceArm64() + kotlinConfig() } diff --git a/kotlinx-uuid-core/build.gradle.kts b/kotlinx-uuid-core/build.gradle.kts index b689070..e1c62cb 100644 --- a/kotlinx-uuid-core/build.gradle.kts +++ b/kotlinx-uuid-core/build.gradle.kts @@ -20,38 +20,6 @@ kotlin { } } - jvm() - js(IR) { - browser() - nodejs() - } - - // tier 1 - linuxX64() - macosX64() - macosArm64() - iosSimulatorArm64() - iosX64() - - // tier 2 - linuxArm64() - watchosSimulatorArm64() - watchosX64() - watchosArm32() - watchosArm64() - tvosSimulatorArm64() - tvosX64() - tvosArm64() - iosArm64() - - // tier 3 - androidNativeArm32() - androidNativeArm64() - androidNativeX86() - androidNativeX64() - mingwX64() - watchosDeviceArm64() - sourceSets { commonMain { dependencies { diff --git a/kotlinx-uuid-exposed/build.gradle.kts b/kotlinx-uuid-exposed/build.gradle.kts index 2da0bb3..5c8d3f8 100644 --- a/kotlinx-uuid-exposed/build.gradle.kts +++ b/kotlinx-uuid-exposed/build.gradle.kts @@ -5,9 +5,9 @@ plugins { id("kotlinJvm") + id("publish") id("dokkaLicensee") id("kover") - id("publish") } kotlin.jvmToolchain(11) diff --git a/kotlinx-uuid-sqldelight/build.gradle.kts b/kotlinx-uuid-sqldelight/build.gradle.kts index 273dbb8..11b9f06 100644 --- a/kotlinx-uuid-sqldelight/build.gradle.kts +++ b/kotlinx-uuid-sqldelight/build.gradle.kts @@ -8,38 +8,6 @@ plugins { } kotlin { - jvm() - js(IR) { - browser() - nodejs() - } - - // tier 1 - linuxX64() - macosX64() - macosArm64() - iosSimulatorArm64() - iosX64() - - // tier 2 - linuxArm64() - watchosSimulatorArm64() - watchosX64() - watchosArm32() - watchosArm64() - tvosSimulatorArm64() - tvosX64() - tvosArm64() - iosArm64() - - // tier 3 - androidNativeArm32() - androidNativeArm64() - androidNativeX86() - androidNativeX64() - mingwX64() - watchosDeviceArm64() - sourceSets { commonMain { dependencies { diff --git a/settings.gradle.kts b/settings.gradle.kts index 27db3b3..4137414 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -30,6 +30,7 @@ gradleEnterprise { rootProject.name = "kotlinx-uuid" enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") +enableFeaturePreview("STABLE_CONFIGURATION_CACHE") include(":kotlinx-uuid-core") From d2dd4f529c1527ba4cd1a45360e039e5e0658fd1 Mon Sep 17 00:00:00 2001 From: hfhbd Date: Tue, 31 Oct 2023 15:33:54 +0100 Subject: [PATCH 2/2] CI: use config cache and test on macOS --- .github/workflows/CI.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 66d2802..a025944 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -18,6 +18,10 @@ jobs: steps: - uses: actions/checkout@v4 + - uses: actions/setup-java@v3 + with: + distribution: 'adopt' + java-version: 11 - uses: gradle/gradle-build-action@v2 with: dependency-graph: generate-and-submit