From 80772734dd32f696756e5b70c4bb1f3673c54dfb Mon Sep 17 00:00:00 2001 From: Marco Gomiero Date: Sun, 8 Nov 2026 17:14:22 +0100 Subject: [PATCH 1/2] Speed up CI by cutting macOS queueing and cold builds Most of the 25-33 minute runs were spent waiting for macOS runners and rebuilding from a cold cache, not testing. - Cancel superseded runs on the same branch or PR. - Build the four Apple samples in one macOS job instead of four. - Run the sample builds alongside the tests instead of after them. - Run JVM, Android, JS and Wasm tests on Linux; keep only the Apple tests and the klib API check on macOS. The x64 test binaries, whose tests were skipped on arm64 runners, are no longer linked. - Key the konan cache on the Kotlin version with a restore key, so a dependency bump no longer downloads the toolchain again; drop it from Linux jobs, which never use it. - Enable Gradle parallel execution and the build cache, raise the heap to 4 GB, and drop the deprecated gradle-home-cache-cleanup input. --- .github/workflows/pr-checks.yaml | 254 ++++++++----------------------- gradle.properties | 4 +- 2 files changed, 69 insertions(+), 189 deletions(-) diff --git a/.github/workflows/pr-checks.yaml b/.github/workflows/pr-checks.yaml index 7ab53d53..17781298 100644 --- a/.github/workflows/pr-checks.yaml +++ b/.github/workflows/pr-checks.yaml @@ -4,13 +4,19 @@ on: branches: - 'master' pull_request: - branches: + branches: - '*' +# A newer push to the same branch or PR supersedes the run in progress, +# so stale runs stop holding the limited macOS runners. +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: - test: - name: Run tests - runs-on: macos-latest + test-jvm-web: + name: Run JVM, Android and web tests + runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 @@ -21,18 +27,50 @@ jobs: java-version: 21 - uses: gradle/actions/setup-gradle@v6 + + - name: Test + run: ./gradlew :rssparser:jvmTest :rssparser:testAndroidHostTest :rssparser:jsTest :rssparser:wasmJsTest :rssparser:jvmApiCheck + + - name: (Fail-only) Bundle test reports + if: failure() + run: find . -type d -name 'reports' | zip -@ -r build-reports.zip + + - name: (Fail-only) Upload the build report + if: failure() + uses: actions/upload-artifact@v7 + with: + name: error-report-jvm-web + path: build-reports.zip + + test-apple: + name: Run Apple tests and klib API check + runs-on: macos-latest + steps: + - uses: actions/checkout@v7 + + - name: set up JDK + uses: actions/setup-java@v6 with: - gradle-home-cache-cleanup: true + distribution: 'zulu' + java-version: 21 + + - uses: gradle/actions/setup-gradle@v6 + + - name: Read Kotlin version + id: kotlin + run: echo "version=$(sed -n 's/^kotlin = "\(.*\)"/\1/p' gradle/libs.versions.toml)" >> "$GITHUB_OUTPUT" - name: Cache KMP tooling uses: actions/cache@v6 with: path: | ~/.konan - key: ${{ runner.os }}-v1-${{ hashFiles('**/libs.versions.toml') }} + key: ${{ runner.os }}-konan-${{ steps.kotlin.outputs.version }} + restore-keys: | + ${{ runner.os }}-konan- - name: Test - run: ./gradlew :rssparser:check + run: ./gradlew :rssparser:iosSimulatorArm64Test :rssparser:macosArm64Test :rssparser:tvosSimulatorArm64Test :rssparser:watchosSimulatorArm64Test :rssparser:klibApiCheck - name: (Fail-only) Bundle test reports if: failure() @@ -42,14 +80,12 @@ jobs: if: failure() uses: actions/upload-artifact@v7 with: - name: error-report + name: error-report-apple path: build-reports.zip - build-android-multiplatform-sample: name: Build Android Multiplatform Sample runs-on: ubuntu-latest - needs: [test] steps: - uses: actions/checkout@v7 @@ -60,15 +96,6 @@ jobs: java-version: 21 - uses: gradle/actions/setup-gradle@v6 - with: - gradle-home-cache-cleanup: true - - - name: Cache KMP tooling - uses: actions/cache@v6 - with: - path: | - ~/.konan - key: ${{ runner.os }}-v1-${{ hashFiles('**/libs.versions.toml') }} - name: Build Android Sample run: ./gradlew :samples:multiplatform:androidApp:assembleRelease @@ -76,7 +103,6 @@ jobs: build-android-sample: name: Build Android Sample runs-on: ubuntu-latest - needs: [test] steps: - uses: actions/checkout@v7 @@ -87,15 +113,6 @@ jobs: java-version: 21 - uses: gradle/actions/setup-gradle@v6 - with: - gradle-home-cache-cleanup: true - - - name: Cache KMP tooling - uses: actions/cache@v6 - with: - path: | - ~/.konan - key: ${{ runner.os }}-v1-${{ hashFiles('**/libs.versions.toml') }} - name: Build Android Sample run: ./gradlew :samples:android:assembleRelease @@ -103,7 +120,6 @@ jobs: build-android-java-sample: name: Build Android Java Sample runs-on: ubuntu-latest - needs: [ test ] steps: - uses: actions/checkout@v7 @@ -114,15 +130,6 @@ jobs: java-version: 21 - uses: gradle/actions/setup-gradle@v6 - with: - gradle-home-cache-cleanup: true - - - name: Cache KMP tooling - uses: actions/cache@v6 - with: - path: | - ~/.konan - key: ${{ runner.os }}-v1-${{ hashFiles('**/libs.versions.toml') }} - name: Build Android Sample run: ./gradlew :samples:java:assembleRelease @@ -130,7 +137,6 @@ jobs: build-desktop-app: name: Build Desktop App runs-on: ubuntu-latest - needs: [test] steps: - uses: actions/checkout@v7 @@ -141,23 +147,13 @@ jobs: java-version: 21 - uses: gradle/actions/setup-gradle@v6 - with: - gradle-home-cache-cleanup: true - - - name: Cache KMP tooling - uses: actions/cache@v6 - with: - path: | - ~/.konan - key: ${{ runner.os }}-v1-${{ hashFiles('**/libs.versions.toml') }} - name: Build Desktop App run: ./gradlew :samples:multiplatform:desktopApp:packageDistributionForCurrentOS - build-ios-sample: - name: Build iOS Sample - runs-on: macos-26 - needs: [test] + build-wasm-sample: + name: Build Wasm Sample + runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 @@ -167,36 +163,16 @@ jobs: distribution: 'zulu' java-version: 21 - - name: Xcode version - run: | - /usr/bin/xcodebuild -version - - - uses: maxim-lobanov/setup-xcode@v1 - with: - xcode-version: 26.5 - - - name: Xcode version - run: | - /usr/bin/xcodebuild -version - - uses: gradle/actions/setup-gradle@v6 - with: - gradle-home-cache-cleanup: true - - - name: Cache KMP tooling - uses: actions/cache@v6 - with: - path: | - ~/.konan - key: ${{ runner.os }}-xcode-26.5-v1-${{ hashFiles('**/libs.versions.toml') }} - - name: Build iOS Sample - run: set -o pipefail && xcodebuild -project samples/multiplatform/iosApp/iosApp.xcodeproj -configuration Debug -scheme iosApp -sdk iphonesimulator -destination 'generic/platform=iOS Simulator' build | xcbeautify --renderer github-actions + - name: Build Wasm Sample + run: ./gradlew :samples:multiplatform:webApp:wasmJsBrowserDistribution - build-macos-sample: - name: Build macOS Sample + # All Apple samples share one macOS runner: the free plan allows only a few + # macOS jobs at once, and the Kotlin framework build is shared between them. + build-apple-samples: + name: Build Apple Samples runs-on: macos-26 - needs: [test] steps: - uses: actions/checkout@v7 @@ -206,134 +182,36 @@ jobs: distribution: 'zulu' java-version: 21 - - name: Xcode version - run: | - /usr/bin/xcodebuild -version - - uses: maxim-lobanov/setup-xcode@v1 with: xcode-version: 26.5 - name: Xcode version - run: | - /usr/bin/xcodebuild -version + run: /usr/bin/xcodebuild -version - uses: gradle/actions/setup-gradle@v6 - with: - gradle-home-cache-cleanup: true + + - name: Read Kotlin version + id: kotlin + run: echo "version=$(sed -n 's/^kotlin = "\(.*\)"/\1/p' gradle/libs.versions.toml)" >> "$GITHUB_OUTPUT" - name: Cache KMP tooling uses: actions/cache@v6 with: path: | ~/.konan - key: ${{ runner.os }}-xcode-26.5-v1-${{ hashFiles('**/libs.versions.toml') }} + key: ${{ runner.os }}-xcode-26.5-konan-${{ steps.kotlin.outputs.version }} + restore-keys: | + ${{ runner.os }}-xcode-26.5-konan- + + - name: Build iOS Sample + run: set -o pipefail && xcodebuild -project samples/multiplatform/iosApp/iosApp.xcodeproj -configuration Debug -scheme iosApp -sdk iphonesimulator -destination 'generic/platform=iOS Simulator' build | xcbeautify --renderer github-actions - name: Build macOS Sample run: set -o pipefail && xcodebuild -project samples/multiplatform/iosApp/iosApp.xcodeproj -configuration Debug -scheme iosApp -destination 'platform=macOS,arch=arm64' CODE_SIGNING_ALLOWED=NO MACOSX_DEPLOYMENT_TARGET=26.0 build | xcbeautify --renderer github-actions - build-tvos-sample: - name: Build tvOS Sample - runs-on: macos-26 - needs: [test] - steps: - - uses: actions/checkout@v7 - - - name: set up JDK - uses: actions/setup-java@v6 - with: - distribution: 'zulu' - java-version: 21 - - - name: Xcode version - run: | - /usr/bin/xcodebuild -version - - - uses: maxim-lobanov/setup-xcode@v1 - with: - xcode-version: 26.5 - - - name: Xcode version - run: | - /usr/bin/xcodebuild -version - - - uses: gradle/actions/setup-gradle@v6 - with: - gradle-home-cache-cleanup: true - - - name: Cache KMP tooling - uses: actions/cache@v6 - with: - path: | - ~/.konan - key: ${{ runner.os }}-xcode-26.5-v1-${{ hashFiles('**/libs.versions.toml') }} - - name: Build tvOS Sample run: set -o pipefail && xcodebuild -project samples/multiplatform/iosApp/iosApp.xcodeproj -configuration Debug -scheme 'iosApp' -destination 'generic/platform=tvOS Simulator' ARCHS=arm64 ONLY_ACTIVE_ARCH=YES build | xcbeautify --renderer github-actions - - build-watchOS-sample: - name: Build watchOS Sample - runs-on: macos-26 - needs: [test] - steps: - - uses: actions/checkout@v7 - - - name: set up JDK - uses: actions/setup-java@v6 - with: - distribution: 'zulu' - java-version: 21 - - - name: Xcode version - run: | - /usr/bin/xcodebuild -version - - - uses: maxim-lobanov/setup-xcode@v1 - with: - xcode-version: 26.5 - - - name: Xcode version - run: | - /usr/bin/xcodebuild -version - - - uses: gradle/actions/setup-gradle@v6 - with: - gradle-home-cache-cleanup: true - - - name: Cache KMP tooling - uses: actions/cache@v6 - with: - path: | - ~/.konan - key: ${{ runner.os }}-xcode-26.5-v1-${{ hashFiles('**/libs.versions.toml') }} - - name: Build watchOS Sample run: set -o pipefail && xcodebuild -project samples/multiplatform/iosApp/iosApp.xcodeproj -scheme 'RssParserDemo Watch App' -destination 'generic/platform=watchOS Simulator' -configuration Debug ARCHS=arm64 ONLY_ACTIVE_ARCH=YES CODE_SIGNING_ALLOWED=NO build | xcbeautify --renderer github-actions - - build-wasm-sample: - name: Build Wasm Sample - runs-on: ubuntu-latest - needs: [ test ] - steps: - - uses: actions/checkout@v7 - - - name: set up JDK - uses: actions/setup-java@v6 - with: - distribution: 'zulu' - java-version: 21 - - - uses: gradle/actions/setup-gradle@v6 - with: - gradle-home-cache-cleanup: true - - - name: Cache KMP tooling - uses: actions/cache@v6 - with: - path: | - ~/.konan - key: ${{ runner.os }}-v1-${{ hashFiles('**/libs.versions.toml') }} - - - name: Build Wasm Sample - run: ./gradlew :samples:multiplatform:webApp:wasmJsBrowserDistribution diff --git a/gradle.properties b/gradle.properties index 0a2862a4..36e2560c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -17,7 +17,9 @@ # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects # org.gradle.parallel=true #Gradle -org.gradle.jvmargs=-Xmx2048M -Dfile.encoding=UTF-8 -Dkotlin.daemon.jvm.options\="-Xmx2048M" +org.gradle.jvmargs=-Xmx4096M -Dfile.encoding=UTF-8 -Dkotlin.daemon.jvm.options\="-Xmx2048M" +org.gradle.parallel=true +org.gradle.caching=true # Android android.enableJetifier=false From ab41f07f26f0ef2fae392798de04080e8249805c Mon Sep 17 00:00:00 2001 From: Marco Gomiero Date: Sun, 8 Nov 2026 17:27:21 +0100 Subject: [PATCH 2/2] Rename JvmAndroidTest source dir to match its source set The source set is jvmAndroidTest, but the directory was JvmAndroidTest. macOS file systems ignore case, so the CI that ran only on macOS never noticed; on Linux the JVM and Android tests failed to compile with NO_ACTUAL_FOR_EXPECT for readFileFromResources. --- .../kotlin/com/prof18/rssparser/JvmAndroidTestUtils.kt | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename rssparser/src/{JvmAndroidTest => jvmAndroidTest}/kotlin/com/prof18/rssparser/JvmAndroidTestUtils.kt (100%) diff --git a/rssparser/src/JvmAndroidTest/kotlin/com/prof18/rssparser/JvmAndroidTestUtils.kt b/rssparser/src/jvmAndroidTest/kotlin/com/prof18/rssparser/JvmAndroidTestUtils.kt similarity index 100% rename from rssparser/src/JvmAndroidTest/kotlin/com/prof18/rssparser/JvmAndroidTestUtils.kt rename to rssparser/src/jvmAndroidTest/kotlin/com/prof18/rssparser/JvmAndroidTestUtils.kt