From eeb0a00db532190a358fe71522aafcbf66ad75fd Mon Sep 17 00:00:00 2001 From: Victor Rodzko Date: Mon, 9 Feb 2026 18:36:46 +0300 Subject: [PATCH] QVAC-0: tests workflow fixes NMTCPP --- ...tion-mobile-test-qvac-lib-infer-nmtcpp.yml | 101 +++++++++++------- 1 file changed, 64 insertions(+), 37 deletions(-) diff --git a/.github/workflows/integration-mobile-test-qvac-lib-infer-nmtcpp.yml b/.github/workflows/integration-mobile-test-qvac-lib-infer-nmtcpp.yml index 0adfe09aeb..77d088766e 100644 --- a/.github/workflows/integration-mobile-test-qvac-lib-infer-nmtcpp.yml +++ b/.github/workflows/integration-mobile-test-qvac-lib-infer-nmtcpp.yml @@ -24,11 +24,11 @@ on: type: string required: false default: main - version: - description: "NPM package version to test (default: latest)" + package: + description: "Full NPM package spec to test (default: @qvac/translation-nmtcpp@latest)" type: string - required: false - default: latest + required: true + default: "@qvac/translation-nmtcpp@latest" env: NODE_VERSION: "lts/*" @@ -115,14 +115,10 @@ jobs: # Configure addon registry cd monorepo/${{ inputs.workdir || env.PKG_DIR }} - ref_name="${{ inputs.ref || github.ref_name }}" - qvac_registry="https://npm.pkg.github.com/" - if [[ "$ref_name" == release-* ]]; then - qvac_registry="https://registry.npmjs.org/" - fi cat > .npmrc < .npmrc < test/mobile/testAssets/bergamot-urls.json echo " \"modelUrl\": \"${BERGAMOT_MODEL_URL}\"," >> test/mobile/testAssets/bergamot-urls.json echo " \"vocabUrl\": \"${BERGAMOT_VOCAB_URL}\"" >> test/mobile/testAssets/bergamot-urls.json echo "}" >> test/mobile/testAssets/bergamot-urls.json - echo "✅ Bergamot URLs bundled for APK at addon/test/mobile/testAssets/bergamot-urls.json" - echo " This will be copied into APK assets during build and accessible via: getAssetPath('bergamot-urls.json')" - echo "📄 Created config file contents:" + echo " ✅ Bergamot URLs bundled" cat test/mobile/testAssets/bergamot-urls.json - echo "" - echo "📂 testAssets directory contents:" - ls -la test/mobile/testAssets/ else - echo "⚠️ Environment variables not set - Bergamot URLs not available" - echo " This means Bergamot tests will be skipped" + echo " ⚠️ Bergamot URLs not available" + fi + + # Bundle IndicTrans URL + if [ -n "${INDICTRANS_MODEL_URL:-}" ]; then + echo "✅ Creating IndicTrans config..." + echo "{" > test/mobile/testAssets/indictrans-model-urls.json + echo " \"modelUrl\": \"${INDICTRANS_MODEL_URL}\"" >> test/mobile/testAssets/indictrans-model-urls.json + echo "}" >> test/mobile/testAssets/indictrans-model-urls.json + echo " ✅ IndicTrans URL bundled" + cat test/mobile/testAssets/indictrans-model-urls.json + else + echo " ⚠️ IndicTrans URL not available" fi + echo "" + echo "📂 testAssets directory contents:" + ls -la test/mobile/testAssets/ + - name: Pack addon working-directory: ./monorepo/${{ inputs.workdir || env.PKG_DIR }} run: | @@ -972,6 +998,7 @@ jobs: env: BERGAMOT_MODEL_URL: ${{ env.BERGAMOT_MODEL_URL }} BERGAMOT_VOCAB_URL: ${{ env.BERGAMOT_VOCAB_URL }} + INDICTRANS_MODEL_URL: ${{ env.INDICTRANS_MODEL_URL }} run: | echo "📝 Creating test spec for custom environment mode..." echo "Platform: ${{ matrix.platform }}"