From 2c5f08a16aeb6931457443ca6273b229142c30f9 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 24 Apr 2026 20:10:03 +0000 Subject: [PATCH 1/3] ci: merge test and build jobs to eliminate duplicate compilation Previously each OS ran Gradle twice (or three times on Ubuntu): once to compile+test, then again to build desktop packages, plus a third run on Ubuntu for Android APKs. Merging these into a single matrix job per OS lets Gradle build the task graph once and reuse compiled classes across test, desktop packaging, and Android assembly. - Combine test + build-desktop into one matrix job (test-and-build) - Fold build-android into the same Ubuntu matrix leg - Use --no-daemon consistently; drop the redundant --stop steps - Raise timeout to 60 min to cover the combined work --- .github/workflows/build.yml | 103 ++++++++++-------------------------- 1 file changed, 29 insertions(+), 74 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f03e5fbfb..8fcdb16f2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,14 +31,26 @@ jobs: - name: Linter (gradle) run: ./gradlew spotlessCheck - test: + test-and-build: needs: lint strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest, windows-latest] + include: + - os: ubuntu-latest + desktop-task: packageDeb + desktop-artifact-name: Desktop Linux DEB + desktop-artifact-path: desktopApp/build/compose/binaries/main/deb/*.deb + - os: macos-latest + desktop-task: packageDmg + desktop-artifact-name: Desktop macOS DMG + desktop-artifact-path: desktopApp/build/compose/binaries/main/dmg/*.dmg + - os: windows-latest + desktop-task: packageMsi + desktop-artifact-name: Desktop Windows MSI + desktop-artifact-path: desktopApp/build/compose/binaries/main/msi/*.msi runs-on: ${{ matrix.os }} - timeout-minutes: 30 + timeout-minutes: 60 defaults: run: shell: bash @@ -53,12 +65,12 @@ jobs: java-version: 21 cache: gradle - - name: Test (gradle) - run: ./gradlew test --no-daemon + - name: Test + Build Desktop (gradle) + run: ./gradlew test :desktopApp:${{ matrix.desktop-task }} --no-daemon - - name: Stop Gradle Daemon - if: always() - run: ./gradlew --stop + - name: Build Android APKs (gradle) + if: matrix.os == 'ubuntu-latest' + run: ./gradlew assembleDebug assembleBenchmark --no-daemon - name: Android Test Report uses: asadmansr/android-test-report-action@v1.2.0 @@ -71,100 +83,43 @@ jobs: name: Test Reports path: amethyst/build/reports - build-android: - needs: test - runs-on: ubuntu-latest - timeout-minutes: 45 - steps: - - name: Checkout code - uses: actions/checkout@v6 - - - name: Set up JDK 21 - uses: actions/setup-java@v5 + - name: Upload Desktop Distribution + uses: actions/upload-artifact@v7 with: - distribution: 'zulu' - java-version: 21 - cache: gradle - - - name: Build APK (gradle) - run: ./gradlew assembleDebug + name: ${{ matrix.desktop-artifact-name }} + path: ${{ matrix.desktop-artifact-path }} - name: Upload Play APK uses: actions/upload-artifact@v7 + if: matrix.os == 'ubuntu-latest' with: name: Play Debug APK path: amethyst/build/outputs/apk/play/debug/amethyst-play-universal-debug.apk - name: Upload FDroid APK uses: actions/upload-artifact@v7 + if: matrix.os == 'ubuntu-latest' with: name: FDroid Debug APK path: amethyst/build/outputs/apk/fdroid/debug/amethyst-fdroid-universal-debug.apk - - name: Build Benchmark APK (gradle) - run: ./gradlew assembleBenchmark - - name: Upload Play APK Benchmark uses: actions/upload-artifact@v7 + if: matrix.os == 'ubuntu-latest' with: name: Play Benchmark APK path: amethyst/build/outputs/apk/play/benchmark/amethyst-play-universal-benchmark.apk - name: Upload FDroid APK Benchmark uses: actions/upload-artifact@v7 + if: matrix.os == 'ubuntu-latest' with: name: FDroid Benchmark APK path: amethyst/build/outputs/apk/fdroid/benchmark/amethyst-fdroid-universal-benchmark.apk - name: Upload Compose Reports uses: actions/upload-artifact@v7 + if: matrix.os == 'ubuntu-latest' with: name: Compose Reports path: amethyst/build/compose_compiler - - build-desktop: - needs: test - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-latest - task: packageDeb - artifact-name: Desktop Linux DEB - artifact-path: desktopApp/build/compose/binaries/main/deb/*.deb - - os: macos-latest - task: packageDmg - artifact-name: Desktop macOS DMG - artifact-path: desktopApp/build/compose/binaries/main/dmg/*.dmg - - os: windows-latest - task: packageMsi - artifact-name: Desktop Windows MSI - artifact-path: desktopApp/build/compose/binaries/main/msi/*.msi - runs-on: ${{ matrix.os }} - timeout-minutes: 30 - defaults: - run: - shell: bash - steps: - - name: Checkout code - uses: actions/checkout@v6 - - - name: Set up JDK 21 - uses: actions/setup-java@v5 - with: - distribution: 'zulu' - java-version: 21 - cache: gradle - - - name: Build Desktop Distribution - run: ./gradlew :desktopApp:${{ matrix.task }} - - - name: Stop Gradle Daemon - if: always() - run: ./gradlew --stop - - - name: Upload Desktop Distribution - uses: actions/upload-artifact@v7 - with: - name: ${{ matrix.artifact-name }} - path: ${{ matrix.artifact-path }} From 6d930ef3cc4fdb28892641f62b9c0132a225746f Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 24 Apr 2026 20:52:19 +0000 Subject: [PATCH 2/3] ci: split assembleDebug and assembleBenchmark into separate gradle calls MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Combining them into a single Gradle invocation caused :amethyst:packagePlayBenchmark to fail inside AGP's IncrementalSplitterRunnable worker — both variants share packaging state in one task graph and the benchmark leg trips on it. The old workflow always ran these as two separate `./gradlew` calls. Match that pattern. They still run on the same runner with a warm Gradle cache, so the compilation savings from sharing quartz/commons with the test+packageDeb step are preserved; we only pay two Gradle startups, which is trivial. --- .github/workflows/build.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8fcdb16f2..2385bf308 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -68,9 +68,13 @@ jobs: - name: Test + Build Desktop (gradle) run: ./gradlew test :desktopApp:${{ matrix.desktop-task }} --no-daemon - - name: Build Android APKs (gradle) + - name: Build Android Debug APKs (gradle) if: matrix.os == 'ubuntu-latest' - run: ./gradlew assembleDebug assembleBenchmark --no-daemon + run: ./gradlew assembleDebug --no-daemon + + - name: Build Android Benchmark APKs (gradle) + if: matrix.os == 'ubuntu-latest' + run: ./gradlew assembleBenchmark --no-daemon - name: Android Test Report uses: asadmansr/android-test-report-action@v1.2.0 From ca92c5a87aabbc843d6e2bd136bd48501b7e39e3 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 24 Apr 2026 20:56:34 +0000 Subject: [PATCH 3/3] ci: drop assembleDebug and its APK uploads The release workflow builds its own signed release APKs/AABs and does not consume the debug outputs. Testers use the Benchmark APK, which is still built and uploaded. Dropping assembleDebug removes a redundant APK packaging pass from every PR/main run. --- .github/workflows/build.yml | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2385bf308..905fe4aa0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -68,10 +68,6 @@ jobs: - name: Test + Build Desktop (gradle) run: ./gradlew test :desktopApp:${{ matrix.desktop-task }} --no-daemon - - name: Build Android Debug APKs (gradle) - if: matrix.os == 'ubuntu-latest' - run: ./gradlew assembleDebug --no-daemon - - name: Build Android Benchmark APKs (gradle) if: matrix.os == 'ubuntu-latest' run: ./gradlew assembleBenchmark --no-daemon @@ -93,20 +89,6 @@ jobs: name: ${{ matrix.desktop-artifact-name }} path: ${{ matrix.desktop-artifact-path }} - - name: Upload Play APK - uses: actions/upload-artifact@v7 - if: matrix.os == 'ubuntu-latest' - with: - name: Play Debug APK - path: amethyst/build/outputs/apk/play/debug/amethyst-play-universal-debug.apk - - - name: Upload FDroid APK - uses: actions/upload-artifact@v7 - if: matrix.os == 'ubuntu-latest' - with: - name: FDroid Debug APK - path: amethyst/build/outputs/apk/fdroid/debug/amethyst-fdroid-universal-debug.apk - - name: Upload Play APK Benchmark uses: actions/upload-artifact@v7 if: matrix.os == 'ubuntu-latest'