ci: cut the pipeline from 13 minutes to a single fast build
CI / build (push) Successful in 1m53s

The production Wasm optimizer dominated the old run (about 10 of 13
minutes). Main/PR builds now produce the development Wasm bundle, while
the optimized bundle and desktop fat jar are built only for release tags.

Merge test and build into one job so a checkout and a Gradle run are not
repeated, and bake the Gradle dependency cache plus the Android SDK into
the CI image. Raise the version of the image to 2.
This commit is contained in:
TapTap committed 2026-11-14 19:51:11 +00:00
1 parent 3281e46104
commit 7fb41b5ad4
5 files changed
+60 -29

No files matched your search

+25 -20
View File
@@ -11,42 +11,47 @@ on:
env:
# Built by scripts/build-ci-image.sh from ci/Dockerfile.
CI_IMAGE: gitea.tap-tap.win/taptap/audiomanager-client-ci:1
CI_IMAGE: gitea.tap-tap.win/taptap/audiomanager-client-ci:2
jobs:
test:
runs-on: ubuntu-latest
container:
image: gitea.tap-tap.win/taptap/audiomanager-client-ci:1
steps:
- uses: actions/checkout@v4
- name: Unit tests
run: gradle :composeApp:desktopTest --console=plain
build:
needs: test
runs-on: ubuntu-latest
permissions:
contents: write
container:
image: gitea.tap-tap.win/taptap/audiomanager-client-ci:1
image: gitea.tap-tap.win/taptap/audiomanager-client-ci:2
steps:
- uses: actions/checkout@v4
- name: Build Android, desktop and web
- name: Test and build
run: |
gradle \
:composeApp:assembleDebug \
:composeApp:packageUberJarForCurrentOS \
:composeApp:wasmJsBrowserDistribution \
--console=plain
set -euo pipefail
if [[ "$GITHUB_REF" == refs/tags/* ]]; then
gradle \
:composeApp:desktopTest \
:composeApp:assembleDebug \
:composeApp:packageUberJarForCurrentOS \
:composeApp:wasmJsBrowserDistribution \
--console=plain
else
# The optimized Wasm build is CPU-bound and slow; main/PR builds
# only need to prove the web target compiles and bundles.
gradle \
:composeApp:desktopTest \
:composeApp:assembleDebug \
:composeApp:wasmJsBrowserDevelopmentExecutableDistribution \
--console=plain
fi
- name: Collect artifacts
run: |
set -euo pipefail
mkdir -p dist
cp composeApp/build/outputs/apk/debug/composeApp-debug.apk dist/AudioManager.apk
cp composeApp/build/compose/jars/*.jar dist/AudioManager-desktop.jar
(cd composeApp/build/dist/wasmJs/productionExecutable && zip -qr "$GITHUB_WORKSPACE/dist/AudioManager-web.zip" .)
if [[ "$GITHUB_REF" == refs/tags/* ]]; then
cp composeApp/build/compose/jars/*.jar dist/AudioManager-desktop.jar
(cd composeApp/build/dist/wasmJs/productionExecutable && zip -qr "$GITHUB_WORKSPACE/dist/AudioManager-web.zip" .)
fi
- name: Publish release assets
if: startsWith(github.ref, 'refs/tags/')