From 9037c797220ffddf59114bc386f191123c6e59e0 Mon Sep 17 00:00:00 2001 From: Jacob Cable Date: Mon, 18 May 2026 13:15:46 +0100 Subject: [PATCH 1/2] ci: build tfjs-node native addon for firestore-semantic-search `npm ci --ignore-scripts` and `lerna bootstrap --ignore-scripts` skip the @tensorflow/tfjs-node postinstall that fetches its native addon (tfjs_binding.node). Without it every firestore-semantic-search suite that requires '@tensorflow/tfjs-node' fails to load, reddening the whole test workflow on every PR. Add a retried step to rebuild the addon from source after bootstrap. --- .github/workflows/test.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 47b7c0ab..b9c9a2f8 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -57,6 +57,18 @@ jobs: - name: Bootstrap monorepo dependencies run: npx lerna bootstrap --no-ci --ignore-scripts + # Dependencies are installed with --ignore-scripts, which skips the + # @tensorflow/tfjs-node postinstall that fetches its native addon. Build + # the addon from source so firestore-semantic-search test suites that + # require('@tensorflow/tfjs-node') can load. + - name: Build firestore-semantic-search native addon (tfjs-node) + uses: nick-invision/retry@v1 + with: + timeout_minutes: 15 + retry_wait_seconds: 30 + max_attempts: 3 + command: cd firestore-semantic-search/functions && npm rebuild @tensorflow/tfjs-node --build-addon-from-source + - name: Build emulator functions run: | cd _emulator/functions From d632c9483c0587b78e1b88a7663c9fd24786435a Mon Sep 17 00:00:00 2001 From: Jacob Cable Date: Mon, 18 May 2026 13:25:32 +0100 Subject: [PATCH 2/2] ci: also build tfjs-node addon for storage-reverse-image-search storage-reverse-image-search/functions has the same @tensorflow/tfjs-node dependency and fails to load its test suites in CI for the same --ignore-scripts reason. Generalise the rebuild step to loop over both affected extensions. --- .github/workflows/test.yaml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index b9c9a2f8..f8c861d6 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -59,15 +59,18 @@ jobs: # Dependencies are installed with --ignore-scripts, which skips the # @tensorflow/tfjs-node postinstall that fetches its native addon. Build - # the addon from source so firestore-semantic-search test suites that - # require('@tensorflow/tfjs-node') can load. - - name: Build firestore-semantic-search native addon (tfjs-node) + # the addon from source so test suites that require('@tensorflow/tfjs-node') + # can load (firestore-semantic-search and storage-reverse-image-search). + - name: Build tfjs-node native addons uses: nick-invision/retry@v1 with: - timeout_minutes: 15 + timeout_minutes: 20 retry_wait_seconds: 30 max_attempts: 3 - command: cd firestore-semantic-search/functions && npm rebuild @tensorflow/tfjs-node --build-addon-from-source + command: | + for ext in firestore-semantic-search storage-reverse-image-search; do + (cd "$ext/functions" && npm rebuild @tensorflow/tfjs-node --build-addon-from-source) + done - name: Build emulator functions run: |