From 8c5c50cac6d05e15f08456ebeec2d626e246bf86 Mon Sep 17 00:00:00 2001 From: Adam Jones Date: Mon, 6 Jan 2025 01:04:02 +0000 Subject: [PATCH 1/2] ci: Add integration tests And update integration test to actually fail (exit with non-zero status code) when there is a problem --- .github/workflows/integration.yml | 31 +++++++++++++++++++++++++++++++ example/index.ts | 1 + 2 files changed, 32 insertions(+) create mode 100644 .github/workflows/integration.yml diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml new file mode 100644 index 0000000..439495c --- /dev/null +++ b/.github/workflows/integration.yml @@ -0,0 +1,31 @@ +name: Integration test + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + test: + name: Test on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + + steps: + - uses: actions/checkout@v4 + with: + submodules: true + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: lts/* + + - name: Install dependencies + run: npm ci + + - name: Run tests + run: npm test diff --git a/example/index.ts b/example/index.ts index d06280e..534a4fb 100644 --- a/example/index.ts +++ b/example/index.ts @@ -20,6 +20,7 @@ async function convert() { }) } catch (exc) { console.error(exc) + process.exit(1) } } From 961be12f776f3c73f77f12ef4064b96f3454feab Mon Sep 17 00:00:00 2001 From: Adam Jones Date: Mon, 6 Jan 2025 02:06:07 +0000 Subject: [PATCH 2/2] test: use tiny.en model to speed up download --- example/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/example/index.ts b/example/index.ts index 534a4fb..532ba04 100644 --- a/example/index.ts +++ b/example/index.ts @@ -10,8 +10,8 @@ const filePath = path.resolve(__dirname, AUDIO_FILE) async function convert() { try { await nodewhisper(filePath, { - modelName: 'base.en', - autoDownloadModelName: 'base.en', + modelName: 'tiny.en', + autoDownloadModelName: 'tiny.en', whisperOptions: { outputInVtt: true, // Default is 20 which is too long