diff --git a/.gitea/workflows/build-and-test.yml b/.gitea/workflows/build-and-test.yml index f8c57c3..1fbd334 100644 --- a/.gitea/workflows/build-and-test.yml +++ b/.gitea/workflows/build-and-test.yml @@ -60,16 +60,24 @@ jobs: cargo test cd .. - build: - name: Build Android APK + # Fast per-commit Android compile check. This does NOT build a shippable APK: + # the full signed release APK is built only on tag pushes by build-release.yml + # (which runs sync-android-sources.sh + signing). Running the full bundle here + # too would duplicate a ~15min build and, without the sync step, produced an + # unsigned APK missing our custom sources/icons/proguard rules anyway. + # `cargo check` for the Android target (~1min) catches Android-specific Rust + # breakage without linking, bundling, or signing. + android-check: + name: Android Compile Check runs-on: linux/amd64 needs: test container: image: gitea.tourolle.paris/dtourolle/jellytau-builder:latest env: ANDROID_HOME: /opt/android-sdk - NDK_VERSION: 27.0.11902837 + ANDROID_SDK_ROOT: /opt/android-sdk NDK_HOME: /opt/android-sdk/ndk/27.0.11902837 + ANDROID_NDK_HOME: /opt/android-sdk/ndk/27.0.11902837 steps: - name: Checkout repository @@ -97,42 +105,13 @@ jobs: ${{ runner.os }}-bun- - name: Install dependencies - run: | - bun install + run: bun install - - name: Build frontend - run: bun run build - - - name: Ensure Android NDK - run: | - if [ ! -d "$NDK_HOME" ]; then - echo "NDK not found at $NDK_HOME, installing ndk;$NDK_VERSION" - yes | "$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" --sdk_root="$ANDROID_HOME" "ndk;$NDK_VERSION" - fi - echo "Using NDK at $NDK_HOME" - ls "$NDK_HOME" - - - name: Initialize Android project + - name: Cargo check (aarch64-linux-android) run: | + TC="$NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin" + export CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER="$TC/aarch64-linux-android24-clang" + export CC_aarch64_linux_android="$TC/aarch64-linux-android24-clang" + export AR_aarch64_linux_android="$TC/llvm-ar" cd src-tauri - echo "" | bunx tauri android init - cd .. - - - name: Build Android APK - id: build - run: | - mkdir -p artifacts - bun run tauri android build --apk true --target aarch64 - - # Find the generated APK file - ARTIFACT=$(find src-tauri/gen/android/app/build/outputs/apk -name "*.apk" -type f -print -quit) - echo "artifact=${ARTIFACT}" >> $GITHUB_OUTPUT - echo "Found artifact: ${ARTIFACT}" - - - name: Upload build artifact - uses: actions/upload-artifact@v3 - with: - name: jellytau-apk - path: ${{ steps.build.outputs.artifact }} - retention-days: 30 - if-no-files-found: error + cargo check --target aarch64-linux-android --lib