ci: bootstrap rustup in-workflow (runner image has no Rust) #47

Merged
dcharlot merged 1 commit from ci-rust-setup into main 2026-07-26 01:59:10 -04:00
5 changed files with 63 additions and 30 deletions

View file

@ -25,10 +25,16 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: "1.97.1"
# Bootstrap rustup: the docker runner image ships no Rust, and
# dtolnay/rust-toolchain cannot help — it calls `rustup`, which is absent.
- name: Install Rust 1.97.1
run: |
export PATH="$HOME/.cargo/bin:$PATH"
command -v rustup >/dev/null 2>&1 || \
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain 1.97.1
rustup toolchain install 1.97.1 --profile minimal
rustup default 1.97.1
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
- name: Cache cargo
uses: actions/cache@v4

View file

@ -33,10 +33,16 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust toolchain (workspace pin)
uses: dtolnay/rust-toolchain@stable
with:
toolchain: "1.97.1"
# Bootstrap rustup: the docker runner image ships no Rust, and
# dtolnay/rust-toolchain cannot help — it calls `rustup`, which is absent.
- name: Install Rust 1.97.1
run: |
export PATH="$HOME/.cargo/bin:$PATH"
command -v rustup >/dev/null 2>&1 || \
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain 1.97.1
rustup toolchain install 1.97.1 --profile minimal
rustup default 1.97.1
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
- name: Cache cargo registry + target
uses: actions/cache@v4

View file

@ -49,10 +49,16 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.97.1
# Bootstrap rustup: the docker runner image ships no Rust, and
# dtolnay/rust-toolchain cannot help — it calls `rustup`, which is absent.
- name: Install Rust 1.97.1
run: |
export PATH="$HOME/.cargo/bin:$PATH"
command -v rustup >/dev/null 2>&1 || \
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain 1.97.1
rustup toolchain install 1.97.1 --profile minimal
rustup default 1.97.1
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
- name: Decode fixtures, assert golden bytes
working-directory: wai/byte-exact-conformance

View file

@ -45,14 +45,18 @@ jobs:
os: [linux, linux-arm64, macos, windows]
steps:
- uses: actions/checkout@v5
# The self-hosted macOS runner is a `host` executor started from launchd,
# whose PATH does not include ~/.cargo/bin — rustup is installed but not
# findable. Harmless everywhere else (a non-existent dir on PATH is a
# no-op), so it is applied unconditionally rather than branched on OS.
- name: Put cargo on PATH
run: echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
- name: Rust 1.97.1
run: rustup toolchain install 1.97.1 --profile minimal && rustup default 1.97.1
# Bootstraps rustup on the minimal docker image (linux / linux-arm64 /
# windows runners ship no Rust at all) and also covers the macOS `host`
# runner, whose launchd PATH omits ~/.cargo/bin. dtolnay/rust-toolchain
# is NOT usable here: it calls `rustup`, which the docker image lacks.
- name: Install Rust 1.97.1
run: |
export PATH="$HOME/.cargo/bin:$PATH"
command -v rustup >/dev/null 2>&1 || \
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain 1.97.1
rustup toolchain install 1.97.1 --profile minimal
rustup default 1.97.1
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
- name: Build the cargo classes (pure Rust, no C codec chain)
working-directory: wai/wai-rs
# neural_int joins the pure-Rust set: the integer-synthesis decoder is
@ -95,14 +99,18 @@ jobs:
os: [linux, linux-arm64, macos, windows]
steps:
- uses: actions/checkout@v5
# The self-hosted macOS runner is a `host` executor started from launchd,
# whose PATH does not include ~/.cargo/bin — rustup is installed but not
# findable. Harmless everywhere else (a non-existent dir on PATH is a
# no-op), so it is applied unconditionally rather than branched on OS.
- name: Put cargo on PATH
run: echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
- name: Rust 1.97.1
run: rustup toolchain install 1.97.1 --profile minimal && rustup default 1.97.1
# Bootstraps rustup on the minimal docker image (linux / linux-arm64 /
# windows runners ship no Rust at all) and also covers the macOS `host`
# runner, whose launchd PATH omits ~/.cargo/bin. dtolnay/rust-toolchain
# is NOT usable here: it calls `rustup`, which the docker image lacks.
- name: Install Rust 1.97.1
run: |
export PATH="$HOME/.cargo/bin:$PATH"
command -v rustup >/dev/null 2>&1 || \
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain 1.97.1
rustup toolchain install 1.97.1 --profile minimal
rustup default 1.97.1
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
- name: Integer rANS + int_synth + JPEG-AI mANS goldens (one machine → every machine)
working-directory: wai/byte-exact-conformance
run: cargo test --release

View file

@ -47,8 +47,15 @@ jobs:
- name: Build the synthetic fixtures (elic / mlicpp / snac / dcvc / glc)
working-directory: wai
run: python tools/wai_validate_synthetic.py --size 256
- name: Rust 1.97.1
run: rustup toolchain install 1.97.1 --profile minimal && rustup default 1.97.1
# Bootstrap rustup: the docker runner image ships no Rust.
- name: Install Rust 1.97.1
run: |
export PATH="$HOME/.cargo/bin:$PATH"
command -v rustup >/dev/null 2>&1 || \
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain 1.97.1
rustup toolchain install 1.97.1 --profile minimal
rustup default 1.97.1
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
- name: Each Rust decoder reproduces its reference end-to-end
working-directory: wai/wai-rs
# --no-default-features: the neural decoders need only `ort`, NOT the C