Skip to content

armgit / sie

Public Imported from GitHub
0

Open-source inference server and production cluster for all the models your agent needs.

ci: stop depending on GitHub release downloads (#922)

Shai Shmuelb49254895430
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 814bff461..a155779e9 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -9,6 +9,15 @@ on:
permissions:
contents: read
+env:
+ # CI runners have no GPU. Leaving the flash-attn extra out keeps the jobs
+ # that sync the Python workspace from fetching its 414 MB prebuilt wheel,
+ # which is served from a GitHub release and not from a package index.
+ SIE_SYNC_NO_EXTRA: flash-attn
+ # onnxruntime-node's install script would otherwise fetch CUDA binaries from
+ # a GitHub release on every install; the runners have no GPU.
+ ONNXRUNTIME_NODE_INSTALL_CUDA: skip
+
concurrency:
group: ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
@@ -23,11 +32,13 @@ jobs:
with:
persist-credentials: false
# Keep the same explicit selection in every exec below to avoid lazy tool installs.
+ - run: bash tools/ci/mise_binary.bash
- uses: jdx/mise-action@c37c93293d6b742fc901e1406b8f764f6fb19dac # v2
with:
version: 2026.5.5
+ sha256: 3aaab5c05a8a94a93b42b4f581779bbd5c44ddb251e7f3639fc671ec5c6aab8a
install_args: --jobs=1 python uv github:rhysd/actionlint
- cache: false
+ cache: true
- run: >-
mise exec --no-deps python uv github:rhysd/actionlint -- uv run --frozen --project . pytest -q
tools/ci/tests/test_required_ci.py tools/ci/tests/test_public_tree.py
@@ -42,15 +53,24 @@ jobs:
timeout-minutes: 60
env:
UV_NO_CACHE: "1"
+ # A clean-machine check builds the Python and pnpm trees from scratch and
+ # installs every extra.
+ SIE_SYNC_NO_EXTRA: ""
steps:
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
with:
persist-credentials: false
+ - run: bash tools/ci/mise_binary.bash
- uses: jdx/mise-action@c37c93293d6b742fc901e1406b8f764f6fb19dac # v2
with:
version: 2026.5.5
- cache: false
+ sha256: 3aaab5c05a8a94a93b42b4f581779bbd5c44ddb251e7f3639fc671ec5c6aab8a
+ # Restores the tool cache the other jobs save; tools/init.sh still runs
+ # the install itself, and the Python and pnpm trees start empty.
+ cache: true
install: false
+ - name: Let pnpm build native addons instead of downloading them
+ run: bash tools/ci/pnpm_native_deps.bash
- run: bash tools/ci/fresh_bootstrap.bash
python:
@@ -61,11 +81,13 @@ jobs:
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
with:
persist-credentials: false
+ - run: bash tools/ci/mise_binary.bash
- uses: jdx/mise-action@c37c93293d6b742fc901e1406b8f764f6fb19dac # v2
with:
version: 2026.5.5
+ sha256: 3aaab5c05a8a94a93b42b4f581779bbd5c44ddb251e7f3639fc671ec5c6aab8a
install_args: --jobs=1
- cache: false
+ cache: true
- run: mise exec -- uv lock --check --project .
- run: mise run sync
- run: mise run lint
@@ -116,14 +138,14 @@ jobs:
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
with:
persist-credentials: false
+ - run: bash tools/ci/mise_binary.bash
- uses: jdx/mise-action@c37c93293d6b742fc901e1406b8f764f6fb19dac # v2
with:
version: 2026.5.5
+ sha256: 3aaab5c05a8a94a93b42b4f581779bbd5c44ddb251e7f3639fc671ec5c6aab8a
install_args: --jobs=1
- cache: false
+ cache: true
- run: mise run sync
- - name: Install the Docker-pinned lock reader
- run: mise install [email protected]
- name: Verify saved bundle closures and input drift
run: mise exec -- uv run --frozen --project . --no-sync python tools/ci/bundle_lock.py check
- name: Validate every saved target with the Docker installer
@@ -142,11 +164,26 @@ jobs:
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
with:
persist-credentials: false
+ - run: bash tools/ci/mise_binary.bash
- uses: jdx/mise-action@c37c93293d6b742fc901e1406b8f764f6fb19dac # v2
with:
version: 2026.5.5
+ sha256: 3aaab5c05a8a94a93b42b4f581779bbd5c44ddb251e7f3639fc671ec5c6aab8a
install_args: --jobs=1
- cache: false
+ cache: true
+ - name: Restore the pnpm workspace
+ id: pnpm-modules
+ uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
+ with:
+ path: |
+ node_modules
+ packages/*/node_modules
+ integrations/*/node_modules
+ examples/*/*/node_modules
+ key: pnpm-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml', 'pnpm-workspace.yaml', 'mise.toml') }}
+ - name: Let pnpm build native addons instead of downloading them
+ if: steps.pnpm-modules.outputs.cache-hit != 'true'
+ run: bash tools/ci/pnpm_native_deps.bash
- run: mise exec -- pnpm install --frozen-lockfile
- run: mise run ts -- build
- run: mise run ts -- typecheck
@@ -161,11 +198,21 @@ jobs:
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
with:
persist-credentials: false
+ - name: Keep the Rust toolchain inside the directory mise-action caches
+ run: |
+ echo "RUSTUP_HOME=$HOME/.local/share/mise/rustup" >> "$GITHUB_ENV"
+ echo "CARGO_HOME=$HOME/.local/share/mise/cargo" >> "$GITHUB_ENV"
+ - run: bash tools/ci/mise_binary.bash
- uses: jdx/mise-action@c37c93293d6b742fc901e1406b8f764f6fb19dac # v2
with:
version: 2026.5.5
+ sha256: 3aaab5c05a8a94a93b42b4f581779bbd5c44ddb251e7f3639fc671ec5c6aab8a
install_args: --jobs=1
- cache: false
+ # With rustup's and cargo's homes set above, the toolchain and its
+ # components restore with the cache. The other jobs leave Rust in
+ # rustup's default home, so this entry needs its own key.
+ cache_key_prefix: mise-rust
+ cache: true
- run: mise run sync
- run: mise run rust-fmt -- --check
- run: mise run rust-check
@@ -197,11 +244,13 @@ jobs:
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
with:
persist-credentials: false
+ - run: bash tools/ci/mise_binary.bash
- uses: jdx/mise-action@c37c93293d6b742fc901e1406b8f764f6fb19dac # v2
with:
version: 2026.5.5
+ sha256: 3aaab5c05a8a94a93b42b4f581779bbd5c44ddb251e7f3639fc671ec5c6aab8a
install_args: --jobs=1
- cache: false
+ cache: true
- run: mise run sync
- run: mise run openapi
- run: >-
@@ -220,12 +269,23 @@ jobs:
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
with:
persist-credentials: false
+ - run: bash tools/ci/mise_binary.bash
- uses: jdx/mise-action@c37c93293d6b742fc901e1406b8f764f6fb19dac # v2
with:
version: 2026.5.5
+ sha256: 3aaab5c05a8a94a93b42b4f581779bbd5c44ddb251e7f3639fc671ec5c6aab8a
install_args: --jobs=1
- cache: false
- - run: mise run helm -- dependencies
+ cache: true
+ - name: Restore the chart dependencies
+ id: helm-charts
+ uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
+ with:
+ path: deploy/helm/sie-cluster/charts
+ key: helm-charts-${{ hashFiles('deploy/helm/sie-cluster/Chart.yaml', 'deploy/helm/sie-cluster/Chart.lock') }}
+ # helm dependency build downloads every chart again even when the
+ # archives are present, so it runs only when the lock changed.
+ - if: steps.helm-charts.outputs.cache-hit != 'true'
+ run: mise run helm -- dependencies
- run: mise run helm -- lint --set payloadStore.enabled=false
- run: mise run helm -- template --set payloadStore.enabled=false >/dev/null
- name: Render public cloud overlays
@@ -258,12 +318,27 @@ jobs:
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
with:
persist-credentials: false
+ - run: bash tools/ci/mise_binary.bash
- uses: jdx/mise-action@c37c93293d6b742fc901e1406b8f764f6fb19dac # v2
with:
version: 2026.5.5
+ sha256: 3aaab5c05a8a94a93b42b4f581779bbd5c44ddb251e7f3639fc671ec5c6aab8a
install_args: --jobs=1
- cache: false
+ cache: true
- run: mise run sync
+ - name: Restore the pnpm workspace
+ id: pnpm-modules
+ uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
+ with:
+ path: |
+ node_modules
+ packages/*/node_modules
+ integrations/*/node_modules
+ examples/*/*/node_modules
+ key: pnpm-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml', 'pnpm-workspace.yaml', 'mise.toml') }}
+ - name: Let pnpm build native addons instead of downloading them
+ if: steps.pnpm-modules.outputs.cache-hit != 'true'
+ run: bash tools/ci/pnpm_native_deps.bash
- run: mise exec -- pnpm install --frozen-lockfile
- run: mise run ts -- build
- run: mise exec -- uv run --frozen --project . --no-sync python tools/ci/live_sdk.py
@@ -288,11 +363,13 @@ jobs:
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
with:
persist-credentials: false
+ - run: bash tools/ci/mise_binary.bash
- uses: jdx/mise-action@c37c93293d6b742fc901e1406b8f764f6fb19dac # v2
with:
version: 2026.5.5
+ sha256: 3aaab5c05a8a94a93b42b4f581779bbd5c44ddb251e7f3639fc671ec5c6aab8a
install_args: --jobs=1
- cache: false
+ cache: true
- run: mise run cpu-stack
- name: Preserve diagnostics
if: always()
diff --git a/.github/workflows/release-npm.yml b/.github/workflows/release-npm.yml
index f2dd7aae4..f2f5dbabb 100644
--- a/.github/workflows/release-npm.yml
+++ b/.github/workflows/release-npm.yml
@@ -28,9 +28,11 @@ jobs:
with:
ref: ${{ github.sha }}
persist-credentials: false
+ - run: bash tools/ci/mise_binary.bash
- uses: jdx/mise-action@c37c93293d6b742fc901e1406b8f764f6fb19dac # v2
with:
version: 2026.5.5
+ sha256: 3aaab5c05a8a94a93b42b4f581779bbd5c44ddb251e7f3639fc671ec5c6aab8a
# Install everything here; later mise exec would auto-install omitted tools.
install_args: --jobs=1
- name: Validate source and optional release identity
@@ -48,6 +50,24 @@ jobs:
test -n "$RELEASE_VERSION"
mise exec -- python tools/ci/release_guard.py build --source-ref "$SOURCE_REF" --version "$RELEASE_VERSION" --tag-name "$RELEASE_TAG"
fi
+ # Pull-request builds reuse the installed pnpm workspace; release builds
+ # start from an empty tree.
+ - name: Restore the pnpm workspace
+ if: inputs.build_only == true
+ id: pnpm-modules
+ uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
+ with:
+ path: |
+ node_modules
+ packages/*/node_modules
+ integrations/*/node_modules
+ examples/*/*/node_modules
+ key: pnpm-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml', 'pnpm-workspace.yaml', 'mise.toml') }}
+ # On release builds the restore step is skipped and its output is empty,
+ # which this condition counts as a miss on purpose.
+ - name: Let pnpm build native addons instead of downloading them
+ if: steps.pnpm-modules.outputs.cache-hit != 'true'
+ run: bash tools/ci/pnpm_native_deps.bash
- name: Build complete archives and test clean packed consumers
env:
RELEASE_VERSION: ${{ inputs.version }}
diff --git a/.github/workflows/release-python.yml b/.github/workflows/release-python.yml
index b69b5a8db..e3854d80e 100644
--- a/.github/workflows/release-python.yml
+++ b/.github/workflows/release-python.yml
@@ -28,9 +28,11 @@ jobs:
with:
ref: ${{ github.sha }}
persist-credentials: false
+ - run: bash tools/ci/mise_binary.bash
- uses: jdx/mise-action@c37c93293d6b742fc901e1406b8f764f6fb19dac # v2
with:
version: 2026.5.5
+ sha256: 3aaab5c05a8a94a93b42b4f581779bbd5c44ddb251e7f3639fc671ec5c6aab8a
# Install everything here; later mise exec would auto-install omitted tools.
install_args: --jobs=1
- name: Validate source and optional release identity
diff --git a/mise.toml b/mise.toml
index 378e93f7f..5d3c39fc2 100644
--- a/mise.toml
+++ b/mise.toml
@@ -3,7 +3,9 @@ experimental = true
[tools]
python = "3.12.12"
-uv = "0.5.31"
+# 0.5.31 is the workspace's uv. 0.9.28 reads the Docker-pinned bundle locks
+# (tools/ci/bundle_lock.py); listing it here keeps it in the CI tool cache.
+uv = ["0.5.31", "0.9.28"]
rust = { version = "1.98.1", profile = "default", components = ["rustfmt", "clippy", "llvm-tools"] }
"cargo:cargo-deny" = "0.20.2"
"cargo:cargo-llvm-cov" = "0.8.7"
diff --git a/packages/sie_server/Dockerfile.cpu b/packages/sie_server/Dockerfile.cpu
index ae132b9f0..5f13ec046 100644
--- a/packages/sie_server/Dockerfile.cpu
+++ b/packages/sie_server/Dockerfile.cpu
@@ -6,6 +6,11 @@
# docker buildx build --platform linux/amd64,linux/arm64 -f packages/sie_server/Dockerfile.cpu -t sie-server:cpu .
ARG BUNDLE=default
+ARG UV_VERSION=0.9.28
+
+# uv comes from its published image on ghcr.io; the installer script would
+# download the binary from a GitHub release on every build.
+FROM ghcr.io/astral-sh/uv:${UV_VERSION} AS uv
# Build the internal Rust extension from checked-in source; it is not published
# to PyPI.
@@ -41,10 +46,7 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
git \
zlib1g-dev
-ARG UV_VERSION=0.9.28
-RUN curl -LsSf https://astral.sh/uv/${UV_VERSION}/install.sh | sh \
- && mv /root/.local/bin/uv /bin/uv \
- && mv /root/.local/bin/uvx /bin/uvx
+COPY --from=uv /uv /uvx /bin/
WORKDIR /app
diff --git a/packages/sie_server/Dockerfile.cuda12 b/packages/sie_server/Dockerfile.cuda12
index a743e485a..36236cea4 100644
--- a/packages/sie_server/Dockerfile.cuda12
+++ b/packages/sie_server/Dockerfile.cuda12
@@ -7,6 +7,10 @@
ARG BUNDLE=default
ARG UV_VERSION=0.9.28
+# uv comes from its published image on ghcr.io; the installer script would
+# download the binary from a GitHub release on every build.
+FROM ghcr.io/astral-sh/uv:${UV_VERSION} AS uv
+
# Build the internal Rust extension from checked-in source; it is not published
# to PyPI.
FROM ghcr.io/pyo3/maturin:v1.13.3 AS audio-prep-builder
@@ -40,10 +44,7 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
curl \
git
-ARG UV_VERSION
-RUN curl -LsSf https://astral.sh/uv/${UV_VERSION}/install.sh | sh \
- && mv /root/.local/bin/uv /bin/uv \
- && mv /root/.local/bin/uvx /bin/uvx
+COPY --from=uv /uv /uvx /bin/
# Install a standalone Python 3.12 from python-build-standalone (fully relocatable,
# glibc 2.17+ compat). This replaces the deadsnakes PPA entirely.
diff --git a/packages/sie_server/Dockerfile.cuda13 b/packages/sie_server/Dockerfile.cuda13
index 13eb810ee..d41bf1cdf 100644
--- a/packages/sie_server/Dockerfile.cuda13
+++ b/packages/sie_server/Dockerfile.cuda13
@@ -23,6 +23,10 @@
ARG BUNDLE=sglang-cu130
ARG UV_VERSION=0.9.28
+# uv comes from its published image on ghcr.io; the installer script would
+# download the binary from a GitHub release on every build.
+FROM ghcr.io/astral-sh/uv:${UV_VERSION} AS uv
+
# Build the native Rust extension from checked-in source; it is not published
# to PyPI.
FROM ghcr.io/pyo3/maturin:v1.13.3 AS audio-prep-builder
@@ -59,10 +63,7 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
libopenmpi3 \
openmpi-bin
-ARG UV_VERSION
-RUN curl -LsSf https://astral.sh/uv/${UV_VERSION}/install.sh | sh \
- && mv /root/.local/bin/uv /bin/uv \
- && mv /root/.local/bin/uvx /bin/uvx
+COPY --from=uv /uv /uvx /bin/
# Install a standalone Python 3.12 from python-build-standalone (fully relocatable,
# glibc 2.17+ compat). This replaces the deadsnakes PPA entirely.
diff --git a/tools/ci/mise_binary.bash b/tools/ci/mise_binary.bash
new file mode 100755
index 000000000..2488ec9bd
--- /dev/null
+++ b/tools/ci/mise_binary.bash
@@ -0,0 +1,43 @@
+#!/usr/bin/env bash
+# Place the pinned mise binary where jdx/mise-action looks for it, so the action
+# skips its own download from GitHub release assets. mise.jdx.dev is mise's
+# release CDN and serves every tagged version; the hash is from the release's
+# SHASUMS256.txt and is the same binary GitHub's release archives carry. The
+# version and hash must match the `version:` and `sha256:` given to every
+# mise-action step: the action hashes the binary it ends up with, whether this
+# script placed it, its cache restored it or it downloaded it. tools/ci/tests
+# check that.
+set -euo pipefail
+
+MISE_VERSION=2026.5.5
+MISE_SHA256_LINUX_X64=3aaab5c05a8a94a93b42b4f581779bbd5c44ddb251e7f3639fc671ec5c6aab8a
+
+case "$(uname -s)-$(uname -m)" in
+ Linux-x86_64)
+ target=linux-x64
+ expected="$MISE_SHA256_LINUX_X64"
+ ;;
+ *)
+ echo "mise_binary.bash: no pinned hash for $(uname -s)-$(uname -m)" >&2
+ exit 1
+ ;;
+esac
+
+bin_dir="${MISE_DATA_DIR:-${XDG_DATA_HOME:-$HOME/.local/share}/mise}/bin"
+mkdir -p "$bin_dir"
+cdn="${MISE_CDN:-https://mise.jdx.dev}"
+# Each attempt is bounded, so a CDN that connects and then stalls cannot hold
+# the job: at most three attempts of a minute each before the fallback below.
+if ! curl -fsSL --connect-timeout 10 --max-time 60 --retry 2 --retry-all-errors --retry-delay 3 \
+ "${cdn}/v${MISE_VERSION}/mise-v${MISE_VERSION}-${target}" \
+ -o "$bin_dir/mise.download"; then
+ # Not fatal: without the binary in place, mise-action downloads it from
+ # GitHub as before, so two independent sources have to fail together.
+ echo "::warning::mise ${MISE_VERSION} could not be fetched from ${cdn}; mise-action will download it instead"
+ rm -f "$bin_dir/mise.download"
+ exit 0
+fi
+echo "${expected} $bin_dir/mise.download" | sha256sum --check --quiet
+chmod +x "$bin_dir/mise.download"
+mv "$bin_dir/mise.download" "$bin_dir/mise"
+"$bin_dir/mise" version
diff --git a/tools/ci/pnpm_native_deps.bash b/tools/ci/pnpm_native_deps.bash
new file mode 100755
index 000000000..c4c7a6625
--- /dev/null
+++ b/tools/ci/pnpm_native_deps.bash
@@ -0,0 +1,28 @@
+#!/usr/bin/env bash
+# Prepare a runner so `pnpm install` builds its native addons locally instead
+# of fetching prebuilt binaries from GitHub release assets.
+#
+# sharp 0.32 (pulled in by chromadb-default-embed) downloads libvips and its
+# own prebuilt addon from GitHub releases unless a global libvips is present;
+# then its install script refuses the download and runs `node-gyp rebuild`.
+# The runner image has no node-gyp on PATH, so install it into the mise node
+# tree, and point node-gyp at that tree's headers so it does not fetch them
+# from nodejs.org either.
+set -euo pipefail
+
+NODE_GYP_VERSION=12.4.0
+
+# Both package sources get retries, so a transient mirror or registry error
+# does not fail the job this script exists to shield.
+sudo apt-get -o Acquire::Retries=3 update -qq
+sudo apt-get -o Acquire::Retries=3 install -y -qq --no-install-recommends libvips-dev
+# Only node is needed here. On the cold bootstrap lane nothing is installed
+# yet, and a bare `mise exec` would install every configured tool at once;
+# tools/init.sh installs them one at a time, so do the same for node first.
+mise install --jobs=1 node
+mise exec --no-deps node -- npm install --global --no-fund --no-audit --fetch-retries 5 "node-gyp@${NODE_GYP_VERSION}"
+node_dir="$(mise where node)"
+if [ -n "${GITHUB_ENV:-}" ]; then
+ echo "npm_config_nodedir=${node_dir}" >> "$GITHUB_ENV"
+fi
+mise exec --no-deps node -- node-gyp --version
diff --git a/tools/ci/tests/test_public_tree.py b/tools/ci/tests/test_public_tree.py
index 2553ee6ec..94145c50b 100644
--- a/tools/ci/tests/test_public_tree.py
+++ b/tools/ci/tests/test_public_tree.py
@@ -61,7 +61,9 @@ def test_root_workspace_uses_the_mise_uv_resolver() -> None:
mise_config = tomllib.loads((REPOSITORY_ROOT / "mise.toml").read_text())
manifest = tomllib.loads((REPOSITORY_ROOT / "pyproject.toml").read_text())
lock = tomllib.loads((REPOSITORY_ROOT / "uv.lock").read_text())
- uv_version = mise_config["tools"]["uv"]
+ uv_versions = mise_config["tools"]["uv"]
+ # mise puts the first listed version on PATH; later entries serve other tasks.
+ uv_version = uv_versions[0] if isinstance(uv_versions, list) else uv_versions
assert f"uv=={uv_version}" in manifest["dependency-groups"]["dev"]
locked_uv = [package for package in lock["package"] if package["name"] == "uv"]
assert len(locked_uv) == 1
diff --git a/tools/ci/tests/test_required_ci.py b/tools/ci/tests/test_required_ci.py
index 890cb3ba3..bfeb5f3ac 100644
--- a/tools/ci/tests/test_required_ci.py
+++ b/tools/ci/tests/test_required_ci.py
@@ -95,11 +95,20 @@ def test_required_check_reports_on_merge_queue_groups():
assert all(context not in json.dumps(document) for document in documents), (name, context)
-def test_bootstrap_is_uncached_and_checks_all_locks():
+def test_bootstrap_builds_fresh_trees_and_checks_all_locks():
+ """The bootstrap lane may restore the tool cache but must build the Python and pnpm trees itself."""
workflow = yaml.safe_load((ROOT / ".github/workflows/ci.yml").read_text())
bootstrap = workflow["jobs"]["bootstrap"]
setup = next(step for step in bootstrap["steps"] if step.get("uses", "").startswith("jdx/mise-action@"))
- assert setup["with"] == {"version": "2026.5.5", "cache": False, "install": False}
+ # The tool cache may be restored (tools/init.sh still runs the install), but
+ # the action itself installs nothing: the lane proves the repository's own
+ # bootstrap, and the Python and pnpm trees must start empty.
+ assert setup["with"] == {
+ "version": "2026.5.5",
+ "sha256": "3aaab5c05a8a94a93b42b4f581779bbd5c44ddb251e7f3639fc671ec5c6aab8a",
+ "cache": True,
+ "install": False,
+ }
script = (ROOT / "tools/ci/fresh_bootstrap.bash").read_text()
assert "./tools/init.sh" in script
assert "test ! -e .venv" in script
@@ -121,6 +130,76 @@ def test_mise_workflow_setups_pin_concrete_versions():
)
+def _ci_workflow_files() -> list:
+ """ci.yml and every reusable workflow it calls."""
+ ci = ROOT / ".github/workflows/ci.yml"
+ called = [
+ ROOT / job["uses"]
+ for job in yaml.safe_load(ci.read_text())["jobs"].values()
+ if job.get("uses", "").startswith("./")
+ ]
+ return [ci, *sorted(set(called))]
+
+
+def test_pnpm_installs_prepare_local_native_builds():
+ """Every job that may run `pnpm install` first runs tools/ci/pnpm_native_deps.bash."""
+ script = (ROOT / "tools/ci/pnpm_native_deps.bash").read_text()
+ assert "libvips-dev" in script
+ assert re.search(r"node-gyp@\$\{NODE_GYP_VERSION\}", script)
+ assert re.search(r"^NODE_GYP_VERSION=[0-9.]+$", script, re.MULTILINE)
+ assert "npm_config_nodedir" in script
+ # The cold bootstrap lane has no tool installed when this runs: node is
+ # installed serially, like tools/init.sh does, and nothing else lazily.
+ assert "mise install --jobs=1 node" in script
+ assert "mise exec -- " not in script
+ assert all(
+ line.startswith("mise exec --no-deps node -- ") for line in script.splitlines() if line.startswith("mise exec")
+ )
+ for path in _ci_workflow_files():
+ workflow = yaml.safe_load(path.read_text())
+ for name, job in workflow["jobs"].items():
+ steps = job.get("steps", [])
+ runs = [step.get("run", "") for step in steps]
+ installs = "\n".join(runs)
+ if (
+ "pnpm install" not in installs
+ and "fresh_bootstrap" not in installs
+ and "distributions.py build npm" not in installs
+ ):
+ continue
+ prepared = [i for i, run in enumerate(runs) if run == "bash tools/ci/pnpm_native_deps.bash"]
+ assert prepared, f"{path.name}: {name} installs the pnpm workspace without preparing native builds"
+ first_install = next(
+ i
+ for i, run in enumerate(runs)
+ if "pnpm install" in run or "fresh_bootstrap" in run or "distributions.py build npm" in run
+ )
+ assert prepared[0] < first_install, f"{path.name}: {name} must prepare native builds before installing"
+
+
+def test_mise_binary_prefetch_matches_every_action_version():
+ """Every mise-action step pins the version and hash tools/ci/mise_binary.bash pre-places, and runs after it."""
+ script = (ROOT / "tools/ci/mise_binary.bash").read_text()
+ pinned = re.search(r"^MISE_VERSION=([0-9.]+)$", script, re.MULTILINE).group(1)
+ digest = re.search(r"^MISE_SHA256_LINUX_X64=(\w+)$", script, re.MULTILINE).group(1)
+ assert re.fullmatch(r"[0-9a-f]{64}", digest)
+ for path in _ci_workflow_files():
+ workflow = yaml.safe_load(path.read_text())
+ for name, job in workflow["jobs"].items():
+ steps = job.get("steps", [])
+ for index, step in enumerate(steps):
+ if not step.get("uses", "").startswith("jdx/mise-action@"):
+ continue
+ assert str(step["with"]["version"]) == pinned, f"{path.name}: {name} pins a different mise"
+ # The action hashes the binary it ends up with, whether this script
+ # placed it, the cache restored it or the action downloaded it.
+ assert step["with"].get("sha256") == digest, f"{path.name}: {name} must verify the mise binary"
+ assert index > 0, f"{path.name}: {name} must fetch the mise binary before jdx/mise-action"
+ assert steps[index - 1].get("run") == "bash tools/ci/mise_binary.bash", (
+ f"{path.name}: {name} must fetch the mise binary before jdx/mise-action"
+ )
+
+
def test_mise_bootstrap_serializes_required_toolsets():
# Unqualified `mise exec` installs missing tools outside install_args.
for path in sorted((ROOT / ".github/workflows").glob("*.y*ml")):
@@ -143,6 +222,7 @@ def test_policy_exec_does_not_lazily_install_unrelated_tools():
workflow = yaml.safe_load((ROOT / ".github/workflows/ci.yml").read_text())
policy = workflow["jobs"]["policy"]
commands = [shlex.split(step["run"]) for step in policy["steps"] if "run" in step]
+ commands = [command for command in commands if command != ["bash", "tools/ci/mise_binary.bash"]]
prefix = ["mise", "exec", "--no-deps", "python", "uv", "github:rhysd/actionlint", "--"]
assert len(commands) == 3
assert all(command[: len(prefix)] == prefix for command in commands)
@@ -254,7 +334,7 @@ def test_helm_render_tests_run_after_chart_dependencies():
def test_cpu_lane_uses_cpu_stack_task():
workflow = yaml.safe_load((ROOT / ".github/workflows/ci.yml").read_text())
commands = [step.get("run") for step in workflow["jobs"]["cpu-stack"]["steps"] if "run" in step]
- assert commands == ["mise run cpu-stack"]
+ assert commands == ["bash tools/ci/mise_binary.bash", "mise run cpu-stack"]
def test_rust_audits_both_committed_dependency_graphs():
diff --git a/tools/mise_tasks/sync.bash b/tools/mise_tasks/sync.bash
index 01582ba04..70c5afe13 100755
--- a/tools/mise_tasks/sync.bash
+++ b/tools/mise_tasks/sync.bash
@@ -8,5 +8,13 @@ set -eu -o pipefail
# without a native toolchain can sync, test, and typecheck.
# Opt in with: mise exec -- uv sync --frozen --project . --all-packages --all-extras
# (requires cmake).
+#
+# SIE_SYNC_NO_EXTRA lists extras to leave out, separated by spaces, for example
+# "flash-attn" on a machine without a GPU. CI sets it; see .github/workflows/ci.yml.
+no_extra=()
+# shellcheck disable=SC2086 # word splitting on purpose
+for extra in ${SIE_SYNC_NO_EXTRA:-}; do
+ no_extra+=(--no-extra "$extra")
+done
mise exec -- uv lock --check --project .
-mise exec -- uv sync --project . --all-packages --all-extras --frozen --no-install-package sie-audio-prep
+mise exec -- uv sync --project . --all-packages --all-extras ${no_extra[@]+"${no_extra[@]}"} --frozen --no-install-package sie-audio-prep
diff --git a/tools/mise_tasks/test-integrations.bash b/tools/mise_tasks/test-integrations.bash
index 1177c47fd..4644ca541 100755
--- a/tools/mise_tasks/test-integrations.bash
+++ b/tools/mise_tasks/test-integrations.bash
@@ -5,8 +5,14 @@
set -euo pipefail
rc=0
+# SIE_SYNC_NO_EXTRA lists extras to leave out, as in tools/mise_tasks/sync.bash.
+no_extra=()
+# shellcheck disable=SC2086 # word splitting on purpose
+for extra in ${SIE_SYNC_NO_EXTRA:-}; do
+ no_extra+=(--no-extra "$extra")
+done
mise exec -- uv lock --check --project .
-mise exec -- uv sync --frozen --project . --all-packages --all-extras --no-install-package sie-audio-prep
+mise exec -- uv sync --frozen --project . --all-packages --all-extras ${no_extra[@]+"${no_extra[@]}"} --no-install-package sie-audio-prep
echo "## Python integration SDK tests"
echo ""