|
| 1 | +# Multi-addon co-load smoke (ggml addons). |
| 2 | +# |
| 3 | +# Per-addon CI loads exactly one addon per run, so it cannot catch the class of |
| 4 | +# bug where addon A and addon B each pass alone but crash when both are |
| 5 | +# dlopen'd into one process (the @qvac/tts-ggml@0.2.1 ggml_backend_is_cpu |
| 6 | +# crash). This workflow runs packages/ggml-coload-smoke, which require()s |
| 7 | +# several @qvac ggml addons into ONE Bare process, across a matrix of |
| 8 | +# combinations (see packages/ggml-coload-smoke/scripts/coload-combinations.mjs): |
| 9 | +# the full set, each ggml stack, cross-stack pairs, and -- on PRs -- combos |
| 10 | +# focused on the addon(s) the PR changed. |
| 11 | +# |
| 12 | +# IMPORTANT: it installs the *published* addons from npm and co-loads those, so |
| 13 | +# on a PR it validates the current REGISTRY BASELINE, not the PR's own diff (a |
| 14 | +# PR's freshly-built change is guarded by the Phase-1 prebuild symbol gate). |
| 15 | +# Follow-up: overlay the PR's freshly-built prebuild for the changed addon |
| 16 | +# (download its prebuild artifact into node_modules/@qvac/<addon>/prebuilds) so |
| 17 | +# the co-load also exercises unpublished changes; the run stays model-free/cheap. |
| 18 | + |
| 19 | +name: Co-load smoke (ggml) |
| 20 | + |
| 21 | +on: |
| 22 | + pull_request: |
| 23 | + paths: |
| 24 | + - "packages/tts-ggml/**" |
| 25 | + - "packages/transcription-parakeet/**" |
| 26 | + - "packages/transcription-whispercpp/**" |
| 27 | + - "packages/bci-whispercpp/**" |
| 28 | + - "packages/llm-llamacpp/**" |
| 29 | + - "packages/embed-llamacpp/**" |
| 30 | + - "packages/classification-ggml/**" |
| 31 | + - "packages/vla-ggml/**" |
| 32 | + - "packages/ocr-ggml/**" |
| 33 | + - "packages/translation-nmtcpp/**" |
| 34 | + - "packages/diffusion-cpp/**" |
| 35 | + - "packages/ggml-coload-smoke/**" |
| 36 | + - ".github/workflows/coload-smoke-ggml.yml" |
| 37 | + workflow_dispatch: |
| 38 | + inputs: |
| 39 | + mode: |
| 40 | + description: "full (every combo) or changed (focus on --addons)" |
| 41 | + type: choice |
| 42 | + options: [full, changed] |
| 43 | + default: full |
| 44 | + addons: |
| 45 | + description: "changed-mode: comma-separated addon short names (e.g. tts-ggml,llm-llamacpp)" |
| 46 | + required: false |
| 47 | + type: string |
| 48 | + |
| 49 | +permissions: |
| 50 | + contents: read |
| 51 | + packages: read |
| 52 | + |
| 53 | +jobs: |
| 54 | + prepare: |
| 55 | + runs-on: ubuntu-latest |
| 56 | + outputs: |
| 57 | + combos: ${{ steps.gen.outputs.combos }} |
| 58 | + steps: |
| 59 | + - name: Checkout |
| 60 | + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # 6.0.2 |
| 61 | + with: |
| 62 | + fetch-depth: 0 |
| 63 | + |
| 64 | + - name: Setup Node.js |
| 65 | + uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # 6.3.0 |
| 66 | + with: |
| 67 | + node-version: lts/* |
| 68 | + |
| 69 | + - name: Compute co-load combinations |
| 70 | + id: gen |
| 71 | + shell: bash |
| 72 | + env: |
| 73 | + EVENT_NAME: ${{ github.event_name }} |
| 74 | + DISPATCH_MODE: ${{ inputs.mode }} |
| 75 | + DISPATCH_ADDONS: ${{ inputs.addons }} |
| 76 | + BASE_SHA: ${{ github.event.pull_request.base.sha }} |
| 77 | + run: | |
| 78 | + set -euo pipefail |
| 79 | + SCRIPT=packages/ggml-coload-smoke/scripts/coload-combinations.mjs |
| 80 | + if [ "$EVENT_NAME" = "workflow_dispatch" ]; then |
| 81 | + if [ "$DISPATCH_MODE" = "changed" ] && [ -n "$DISPATCH_ADDONS" ]; then |
| 82 | + node "$SCRIPT" --changed "$DISPATCH_ADDONS" |
| 83 | + else |
| 84 | + node "$SCRIPT" |
| 85 | + fi |
| 86 | + else |
| 87 | + git diff --name-only "$BASE_SHA" HEAD > /tmp/coload-changed.txt || true |
| 88 | + node "$SCRIPT" --changed-files /tmp/coload-changed.txt |
| 89 | + fi |
| 90 | +
|
| 91 | + coload: |
| 92 | + needs: prepare |
| 93 | + if: ${{ needs.prepare.outputs.combos != '' && needs.prepare.outputs.combos != '[]' }} |
| 94 | + # github-hosted runner: released @qvac addons resolve from public npm with no |
| 95 | + # secrets, so this runs on fork PRs too. It co-loads the PUBLISHED addons; |
| 96 | + # overlaying the PR's freshly built prebuild is a documented follow-up. |
| 97 | + runs-on: ubuntu-latest |
| 98 | + timeout-minutes: 60 |
| 99 | + permissions: |
| 100 | + contents: read |
| 101 | + packages: read |
| 102 | + strategy: |
| 103 | + fail-fast: false |
| 104 | + matrix: |
| 105 | + combo: ${{ fromJSON(needs.prepare.outputs.combos) }} |
| 106 | + name: coload-${{ matrix.combo.name }} |
| 107 | + steps: |
| 108 | + - name: Setup Node.js |
| 109 | + uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # 6.3.0 |
| 110 | + with: |
| 111 | + node-version: lts/* |
| 112 | + |
| 113 | + - name: Checkout |
| 114 | + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # 6.0.2 |
| 115 | + |
| 116 | + - name: Install bare tooling |
| 117 | + shell: bash |
| 118 | + run: npm install -g --force bare bare-make |
| 119 | + |
| 120 | + - name: Install co-load harness deps |
| 121 | + working-directory: packages/ggml-coload-smoke |
| 122 | + shell: bash |
| 123 | + run: npm install |
| 124 | + |
| 125 | + - name: Install addons under test (published) |
| 126 | + working-directory: packages/ggml-coload-smoke |
| 127 | + shell: bash |
| 128 | + env: |
| 129 | + ADDONS: ${{ matrix.combo.addons }} |
| 130 | + run: | |
| 131 | + set -euo pipefail |
| 132 | + PKGS="" |
| 133 | + for a in ${ADDONS//,/ }; do PKGS="$PKGS @qvac/$a"; done |
| 134 | + echo "Installing combo '${{ matrix.combo.name }}': $PKGS" |
| 135 | + npm install --no-save $PKGS |
| 136 | +
|
| 137 | + - name: Co-load smoke |
| 138 | + working-directory: packages/ggml-coload-smoke |
| 139 | + shell: bash |
| 140 | + env: |
| 141 | + COLOAD_ADDONS: ${{ matrix.combo.addons }} |
| 142 | + run: bare test/coload.test.js |
0 commit comments