diff --git a/.github/workflows/build-nitro-node.yml b/.github/workflows/build-nitro-node.yml index 4fe80b692..7ebdb6fde 100644 --- a/.github/workflows/build-nitro-node.yml +++ b/.github/workflows/build-nitro-node.yml @@ -13,189 +13,24 @@ on: paths: [".github/workflows/build-nitro-node.yml", "nitro-node"] workflow_dispatch: -jobs: - ubuntu-amd64-non-cuda-build: - runs-on: ubuntu-latest - steps: - - name: Clone - id: checkout - uses: actions/checkout@v4 - with: - submodules: recursive +env: + LLM_MODEL_URL: https://huggingface.co/TheBloke/TinyLlama-1.1B-Chat-v0.3-GGUF/resolve/main/tinyllama-1.1b-chat-v0.3.Q2_K.gguf + WHISPER_MODEL_URL: https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-tiny-q5_1.bin - - uses: actions/setup-node@v4 - with: - node-version: 18 - - - name: Restore cached model file - id: cache-model-restore - uses: actions/cache/restore@v4 - with: - path: | - nitro-node/test/test_assets/*.gguf - key: ${{ runner.os }}-model-gguf - - - uses: suisei-cn/actions-download-file@v1.4.0 - id: download-model-file - name: Download model file - with: - url: "The model we are using is [tinyllama-1.1b](https://huggingface.co/TheBloke/TinyLlama-1.1B-Chat-v1.0-GGUF/resolve/main/tinyllama-1.1b-chat-v1.0.Q4_K_M.gguf)!" - target: nitro-node/test/test_assets/ - auto-match: true - retry-times: 3 - - - name: Save downloaded model file to cache - id: cache-model-save - uses: actions/cache/save@v4 - with: - path: | - nitro-node/test/test_assets/*.gguf - key: ${{ steps.cache-model-restore.outputs.cache-primary-key }} - - - name: Run tests - id: test_nitro_node - run: | - cd nitro-node - make clean test-ci - - #ubuntu-amd64-build: - # runs-on: ubuntu-18-04-cuda-11-7 - # steps: - # - name: Clone - # id: checkout - # uses: actions/checkout@v4 - # with: - # submodules: recursive - - # - uses: actions/setup-node@v4 - # with: - # node-version: 18 - - # - name: Restore cached model file - # id: cache-model-restore - # uses: actions/cache/restore@v4 - # with: - # path: | - # nitro-node/test/test_assets/*.gguf - # key: ${{ runner.os }}-model-gguf - - # - uses: suisei-cn/actions-download-file@v1.4.0 - # id: download-model-file - # name: Download model file - # with: - # url: "The model we are using is [tinyllama-1.1b](https://huggingface.co/TheBloke/TinyLlama-1.1B-Chat-v1.0-GGUF/resolve/main/tinyllama-1.1b-chat-v1.0.Q4_K_M.gguf)!" - # target: nitro-node/test/test_assets/ - # auto-match: true - # retry-times: 3 - - # - name: Save downloaded model file to cache - # id: cache-model-save - # uses: actions/cache/save@v4 - # with: - # path: | - # nitro-node/test/test_assets/*.gguf - # key: ${{ steps.cache-model-restore.outputs.cache-primary-key }} - - # - name: Run tests - # id: test_nitro_node - # run: | - # cd nitro-node - # make clean test-ci - - #ubuntu-amd64-cuda-build: - # runs-on: ubuntu-18-04-cuda-${{ matrix.cuda }} - # strategy: - # matrix: - # cuda: ["12-0", "11-7"] - - # steps: - # - name: Clone - # id: checkout - # uses: actions/checkout@v4 - # with: - # submodules: recursive - - # - uses: actions/setup-node@v4 - # with: - # node-version: 18 - - # - name: Restore cached model file - # id: cache-model-restore - # uses: actions/cache/restore@v4 - # with: - # path: | - # nitro-node/test/test_assets/*.gguf - # key: ${{ runner.os }}-model-gguf - - # - uses: suisei-cn/actions-download-file@v1.4.0 - # id: download-model-file - # name: Download model file - # with: - # url: "The model we are using is [tinyllama-1.1b](https://huggingface.co/TheBloke/TinyLlama-1.1B-Chat-v1.0-GGUF/resolve/main/tinyllama-1.1b-chat-v1.0.Q4_K_M.gguf)!" - # target: nitro-node/test/test_assets/ - # auto-match: true - # retry-times: 3 - - # - name: Save downloaded model file to cache - # id: cache-model-save - # uses: actions/cache/save@v4 - # with: - # path: | - # nitro-node/test/test_assets/*.gguf - # key: ${{ steps.cache-model-restore.outputs.cache-primary-key }} - - # - name: Run tests - # id: test_nitro_node - # run: | - # cd nitro-node - # make clean test-ci - - macOS-M-build: - runs-on: macos-14 - steps: - - name: Clone - id: checkout - uses: actions/checkout@v4 - with: - submodules: recursive - - - uses: actions/setup-node@v4 - with: - node-version: 18 - - - name: Restore cached model file - id: cache-model-restore - uses: actions/cache/restore@v4 - with: - path: | - nitro-node/test/test_assets/*.gguf - key: ${{ runner.os }}-model-gguf - - - uses: suisei-cn/actions-download-file@v1.4.0 - id: download-model-file - name: Download model file - with: - url: "The model we are using is [tinyllama-1.1b](https://huggingface.co/TheBloke/TinyLlama-1.1B-Chat-v1.0-GGUF/resolve/main/tinyllama-1.1b-chat-v1.0.Q4_K_M.gguf)!" - target: nitro-node/test/test_assets/ - auto-match: true - retry-times: 3 - - - name: Save downloaded model file to cache - id: cache-model-save - uses: actions/cache/save@v4 - with: - path: | - nitro-node/test/test_assets/*.gguf - key: ${{ steps.cache-model-restore.outputs.cache-primary-key }} - - - name: Run tests - id: test_nitro_node - run: | - cd nitro-node - make clean test-ci +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: + - ubuntu-18-04-cuda-12-0 + - ubuntu-18-04-cuda-11-7 + - macos-silicon + - macos-latest + - windows-latest + - windows-cuda-12-0 + - windows-cuda-11-7 - macOS-Intel-build: - runs-on: macos-latest steps: - name: Clone id: checkout @@ -219,7 +54,7 @@ jobs: id: download-model-file name: Download model file with: - url: "The model we are using is [tinyllama-1.1b](https://huggingface.co/TheBloke/TinyLlama-1.1B-Chat-v1.0-GGUF/resolve/main/tinyllama-1.1b-chat-v1.0.Q4_K_M.gguf)!" + url: ${{ env.LLM_MODEL_URL }} target: nitro-node/test/test_assets/ auto-match: true retry-times: 3 @@ -237,119 +72,3 @@ jobs: run: | cd nitro-node make clean test-ci - - #windows-amd64-build: - # runs-on: windows-latest - # steps: - # - name: Clone - - # id: checkout - # uses: actions/checkout@v4 - # with: - # submodules: recursive - - # - uses: actions/setup-node@v4 - # with: - # node-version: 18 - - # - name: Setup VSWhere.exe - # uses: warrenbuckley/Setup-VSWhere@v1 - # with: - # version: latest - # silent: true - # env: - # ACTIONS_ALLOW_UNSECURE_COMMANDS: true - - # - name: Restore cached model file - # id: cache-model-restore - # uses: actions/cache/restore@v4 - # with: - # path: | - # nitro-node/test/test_assets/*.gguf - # key: ${{ runner.os }}-model-gguf - - # - uses: suisei-cn/actions-download-file@v1.4.0 - # id: download-model-file - # name: Download model file - # with: - # url: "The model we are using is [tinyllama-1.1b](https://huggingface.co/TheBloke/TinyLlama-1.1B-Chat-v1.0-GGUF/resolve/main/tinyllama-1.1b-chat-v1.0.Q4_K_M.gguf)!" - # target: nitro-node/test/test_assets/ - # auto-match: true - # retry-times: 3 - - # - name: Save downloaded model file to cache - # id: cache-model-save - # uses: actions/cache/save@v4 - # with: - # path: | - # nitro-node/test/test_assets/*.gguf - # key: ${{ steps.cache-model-restore.outputs.cache-primary-key }} - - # - name: Run tests - # id: test_nitro_node - # run: | - # cd nitro-node - # make clean test-ci - - #windows-amd64-cuda-build: - # runs-on: windows-cuda-${{ matrix.cuda }} - # strategy: - # matrix: - # cuda: ["12-0", "11-7"] - - # steps: - # - name: Clone - # id: checkout - # uses: actions/checkout@v4 - # with: - # submodules: recursive - - # - uses: actions/setup-node@v4 - # with: - # node-version: 18 - - # - name: actions-setup-cmake - # uses: jwlawson/actions-setup-cmake@v1.14.1 - - # - name: Setup VSWhere.exe - # uses: warrenbuckley/Setup-VSWhere@v1 - # with: - # version: latest - # silent: true - # env: - # ACTIONS_ALLOW_UNSECURE_COMMANDS: true - - # - uses: actions/setup-dotnet@v3 - # with: - # dotnet-version: "6.0.x" - - # - name: Restore cached model file - # id: cache-model-restore - # uses: actions/cache/restore@v4 - # with: - # path: | - # nitro-node/test/test_assets/*.gguf - # key: ${{ runner.os }}-model-gguf - - # - uses: suisei-cn/actions-download-file@v1.4.0 - # id: download-model-file - # name: Download model file - # with: - # url: "The model we are using is [tinyllama-1.1b](https://huggingface.co/TheBloke/TinyLlama-1.1B-Chat-v1.0-GGUF/resolve/main/tinyllama-1.1b-chat-v1.0.Q4_K_M.gguf)!" - # target: nitro-node/test/test_assets/ - # auto-match: true - # retry-times: 3 - - # - name: Save downloaded model file to cache - # id: cache-model-save - # uses: actions/cache/save@v4 - # with: - # path: | - # nitro-node/test/test_assets/*.gguf - # key: ${{ steps.cache-model-restore.outputs.cache-primary-key }} - - # - name: Run tests - # id: test_nitro_node - # run: | - # cd nitro-node - # make clean test-ci diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c8b799187..4b3b4e5af 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,6 +24,7 @@ on: "!docs/**", "!.gitignore", "!README.md", + "!nitro-node", ] pull_request: types: [opened, synchronize, reopened] @@ -44,6 +45,7 @@ on: "!docs/**", "!.gitignore", "!README.md", + "!nitro-node", ] workflow_dispatch: diff --git a/.github/workflows/test-install-nitro-node.yml b/.github/workflows/test-install-nitro-node.yml index 755551b82..4c526c748 100644 --- a/.github/workflows/test-install-nitro-node.yml +++ b/.github/workflows/test-install-nitro-node.yml @@ -50,45 +50,19 @@ jobs: path: nitro-node/janhq-nitro-node.tgz if-no-files-found: error - ubuntu-install: - runs-on: ubuntu-latest - needs: [linux-pack-tarball] - if: always() && needs.linux-pack-tarball.result == 'success' - steps: - - name: Clone - id: checkout - uses: actions/checkout@v4 - with: - submodules: recursive - - - uses: actions/setup-node@v4 - with: - node-version: 18 - - - name: Download prebuilt tarball - uses: actions/download-artifact@master - with: - name: janhq-nitro-node - path: .github/scripts/ - - - name: List tarball content - id: tar-tf - run: | - cd .github - cd scripts - tar tf janhq-nitro-node.tgz - - - name: Run tests - id: test_install_nitro_node - env: - NITRO_NODE_PKG: ${{ github.workspace }}/.github/scripts/janhq-nitro-node.tgz - run: | - cd .github - cd scripts - node e2e-test-install-nitro-node.js - - macOS-install: - runs-on: macos-latest + install: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: + - ubuntu-latest + - ubuntu-18-04-cuda-12-0 + - ubuntu-18-04-cuda-11-7 + - macos-silicon + - macos-latest + - windows-latest + - windows-cuda-12-0 + - windows-cuda-11-7 needs: [linux-pack-tarball] if: always() && needs.linux-pack-tarball.result == 'success' steps: @@ -123,41 +97,3 @@ jobs: cd .github cd scripts node e2e-test-install-nitro-node.js - - windows-install: - runs-on: windows-latest - needs: [linux-pack-tarball] - if: always() && needs.linux-pack-tarball.result == 'success' - steps: - - name: Clone - - id: checkout - uses: actions/checkout@v4 - with: - submodules: recursive - - - uses: actions/setup-node@v4 - with: - node-version: 18 - - - name: Download prebuilt tarball - uses: actions/download-artifact@master - with: - name: janhq-nitro-node - path: .github/scripts/ - - - name: List tarball content - id: tar-tf - run: | - cd .github - cd scripts - tar tf janhq-nitro-node.tgz - - - name: Run tests - id: test_install_nitro_node - env: - NITRO_NODE_PKG: ${{ github.workspace }}\.github\scripts\janhq-nitro-node.tgz - run: | - cd .github - cd scripts - node e2e-test-install-nitro-node.js