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 - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Install Rust # Bootstrap rustup: the docker runner image ships no Rust, and
uses: dtolnay/rust-toolchain@master # dtolnay/rust-toolchain cannot help — it calls `rustup`, which is absent.
with: - name: Install Rust 1.97.1
toolchain: "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 - name: Cache cargo
uses: actions/cache@v4 uses: actions/cache@v4

View file

@ -33,10 +33,16 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Install Rust toolchain (workspace pin) # Bootstrap rustup: the docker runner image ships no Rust, and
uses: dtolnay/rust-toolchain@stable # dtolnay/rust-toolchain cannot help — it calls `rustup`, which is absent.
with: - name: Install Rust 1.97.1
toolchain: "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 - name: Cache cargo registry + target
uses: actions/cache@v4 uses: actions/cache@v4

View file

@ -49,10 +49,16 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Install Rust # Bootstrap rustup: the docker runner image ships no Rust, and
uses: dtolnay/rust-toolchain@master # dtolnay/rust-toolchain cannot help — it calls `rustup`, which is absent.
with: - name: Install Rust 1.97.1
toolchain: 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 - name: Decode fixtures, assert golden bytes
working-directory: wai/byte-exact-conformance working-directory: wai/byte-exact-conformance

View file

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

View file

@ -47,8 +47,15 @@ jobs:
- name: Build the synthetic fixtures (elic / mlicpp / snac / dcvc / glc) - name: Build the synthetic fixtures (elic / mlicpp / snac / dcvc / glc)
working-directory: wai working-directory: wai
run: python tools/wai_validate_synthetic.py --size 256 run: python tools/wai_validate_synthetic.py --size 256
- name: Rust 1.97.1 # Bootstrap rustup: the docker runner image ships no Rust.
run: rustup toolchain install 1.97.1 --profile minimal && rustup default 1.97.1 - 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 - name: Each Rust decoder reproduces its reference end-to-end
working-directory: wai/wai-rs working-directory: wai/wai-rs
# --no-default-features: the neural decoders need only `ort`, NOT the C # --no-default-features: the neural decoders need only `ort`, NOT the C