diff --git a/.forgejo/workflows/android.yml b/.forgejo/workflows/android.yml index 4a063e6..ab86392 100644 --- a/.forgejo/workflows/android.yml +++ b/.forgejo/workflows/android.yml @@ -91,6 +91,7 @@ jobs: if [ -n "${ANDROID_KEYSTORE_BASE64:-}" ]; then printf '%s' "$ANDROID_KEYSTORE_BASE64" | base64 -d > /tmp/thoughtsync-release.jks echo "variant=Release" >> $GITHUB_OUTPUT + echo "label=release" >> $GITHUB_OUTPUT # DEBUG profile, in a release APK, deliberately — see the note above # the cargoNdk task. The release profile strips the symbols uniffi # reads its metadata out of, so `generateUniffiBindings` fails @@ -103,6 +104,7 @@ jobs: else echo "::warning::No ANDROID_KEYSTORE_BASE64 secret. Building an UNSIGNED DEBUG APK: it cannot be installed over a signed build and cannot self-update." echo "variant=Debug" >> $GITHUB_OUTPUT + echo "label=debug" >> $GITHUB_OUTPUT echo "profile=debug" >> $GITHUB_OUTPUT echo "keystore=" >> $GITHUB_OUTPUT echo "apk=android/app/build/outputs/apk/debug/app-debug.apk" >> $GITHUB_OUTPUT @@ -140,7 +142,13 @@ jobs: # runtime to load the .so, so those are instrumented tests and belong on # an emulator, not here — the Rust side is covered by the workspace # tests in the desktop lane. - run: ./gradlew test${{ steps.build.outputs.variant }}UnitTest -PTHOUGHTSYNC_CARGO_PROFILE=${{ steps.build.outputs.profile }} + # + # DEBUG regardless of what is being packaged: AGP creates unit-test tasks + # only for `testBuildType`, which is debug, so `testReleaseUnitTest` does + # not exist (run 4082). It costs one extra Kotlin compile and buys the + # type-check on the debug variant, which is the one an emulator build + # would use. + run: ./gradlew testDebugUnitTest -PTHOUGHTSYNC_CARGO_PROFILE=${{ steps.build.outputs.profile }} - name: Assemble the APK env: @@ -174,6 +182,8 @@ jobs: # owner/repo to github.com. See Scribe issues 2255 / 2270. uses: https://git.fabledsword.com/bvandeusen/upload-artifact@cb8afe72b42edc798abfb8fcb556cf660d894245 with: - name: thoughtsync-android-${{ steps.build.outputs.profile }}-${{ github.sha }} + # The APK's variant, NOT the Cargo profile — those are the same word + # for different things and the profile is pinned to debug (#2810). + name: thoughtsync-android-${{ steps.build.outputs.label }}-${{ github.sha }} path: ${{ steps.build.outputs.apk }} if-no-files-found: error