From 7fb272a8e61149c8510ae97dd612629421624612 Mon Sep 17 00:00:00 2001 From: Dmitry Kryaklin Date: Wed, 8 Feb 2023 17:12:00 +0000 Subject: [PATCH] feat(node-addon): add workflow --- .github/workflows/custom-build.yml | 41 ++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/custom-build.yml diff --git a/.github/workflows/custom-build.yml b/.github/workflows/custom-build.yml new file mode 100644 index 0000000..bf07f78 --- /dev/null +++ b/.github/workflows/custom-build.yml @@ -0,0 +1,41 @@ +name: Build and Publish Node.js Addon + +on: + workflow_dispatch: + +jobs: + addon_node-ubuntu-latest: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [16.x, 18.x] + steps: + - name: Clone + uses: actions/checkout@v1 + + - name: Dependencies + run: | + sudo apt-get update + sudo apt-get install build-essential + sudo apt-get install cmake + sudo apt-get install libsdl2-dev + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + + - name: Install package.json dependencies + working-directory: ./examples/addon.node + run: npm install + + - name: Compile addon.node + run: npx cmake-js compile -T whisper-addon -B Release + + - name: Download test model + run: | + bash ./models/download-ggml-model.sh base.en + - name: Test + run: | + cd examples/addon.node + npm run test