Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 78 additions & 0 deletions .github/workflows/collection-android-debug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Collection Android debug build

on:
pull_request:
paths:
- 'apps/collection/package.json'
- 'apps/collection/package-lock.json'
- 'apps/collection/.npmrc'
- 'apps/collection/.nvmrc'
- 'apps/collection/app.json'
- 'apps/collection/assets/*.png'
- 'apps/collection/patches/**'
- 'apps/collection/plugins/**'
- 'apps/collection/android/**'
- '.github/workflows/collection-android-debug.yml'
workflow_dispatch:

permissions:
contents: read

defaults:
run:
shell: bash
working-directory: apps/collection

jobs:
debug:
name: Clean arm64 debug build
runs-on: ubuntu-24.04
timeout-minutes: 45
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
persist-credentials: false
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version-file: apps/collection/.nvmrc
- uses: actions/setup-java@cf277c60eb25467037889841efdb72551f06f6c3 # v4.9.1
with:
distribution: temurin
java-version: 21
- name: Generate Android and compile debug once from clean inputs
env:
CI: '1'
EXPO_NO_DOTENV: '1'
EXPO_PUBLIC_API_URL: http://127.0.0.1:9877
run: |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HIGH · BUG — Pipeline through tee masks build failures

The build step runs { ... } 2>&1 | tee "$evidence/build.log". The default bash on GitHub Actions is invoked with -e but not -o pipefail, so the step's exit status is that of tee, not the command group. If npm ci, the version check, expo prebuild, or the Gradle assembleDebug link fails (exactly the failure this workflow is meant to catch, per the LVT-217 comment), tee succeeds and the job is reported green.

Suggested fix: Add set -o pipefail at the top of the run block (or configure defaults.run.shell as bash -e -o pipefail {0}) so the step fails when the build fails.

Lovat AI review · confidence 0.95 · z-ai/glm-5.3-flash

evidence="$RUNNER_TEMP/collection-android-debug"
mkdir -p "$evidence"
git rev-parse HEAD > "$evidence/source-sha.txt"
{
test ! -e android
test ! -e node_modules
npm ci
node -e 'for (const name of process.argv.slice(1)) console.log(name, require("./node_modules/" + name + "/package.json").version)' \
expo react-native react-native-reanimated react-native-worklets
./node_modules/.bin/expo prebuild --platform android --no-install
# LVT-217 failed on the first debug link of this ABI. No retry or build cache.
(cd android && ./gradlew :app:assembleDebug -PreactNativeArchitectures=arm64-v8a --no-daemon --no-build-cache --stacktrace)
} 2>&1 | tee "$evidence/build.log"
- name: Verify the debug APK signature and native libraries
run: |
evidence="$RUNNER_TEMP/collection-android-debug"
apk=android/app/build/outputs/apk/debug/app-debug.apk
"$ANDROID_HOME/build-tools/37.0.0/apksigner" verify "$apk"
zipinfo -1 "$apk" > "$evidence/apk-entries.txt"
grep -Fx 'lib/arm64-v8a/libreanimated.so' "$evidence/apk-entries.txt"
grep -Fx 'lib/arm64-v8a/libworklets.so' "$evidence/apk-entries.txt"
cp "$apk" "$evidence/collection-arm64-debug.apk"
(cd "$evidence" && sha256sum collection-arm64-debug.apk > apk.sha256)
- name: Retain debug diagnostics and verified APK, when built
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: collection-arm64-debug-${{ github.sha }}
path: ${{ runner.temp }}/collection-android-debug/
if-no-files-found: warn
retention-days: 14
Loading