diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 47b7c0ab..f8c861d6 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -57,6 +57,21 @@ 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 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: 20 + retry_wait_seconds: 30 + max_attempts: 3 + 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: | cd _emulator/functions