diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index 6aceb09..db4fdfb 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -132,7 +132,23 @@ jobs: with: ref: refs/tags/${{ needs.resolve.outputs.tag }} fetch-depth: 0 - - uses: jdx/mise-action@v4 + # Set up the Rust toolchain directly instead of via mise: the self-hosted + # `build` runner (used for x86_64-linux) doesn't ship rustup, so mise's + # `rust = "stable"` silently no-ops and `cargo` goes missing. Install rustup + # when absent, pin stable, and add the cross target this matrix leg builds. + - name: Set up Rust toolchain + shell: bash + run: | + set -euo pipefail + if ! command -v rustup >/dev/null 2>&1; then + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \ + | sh -s -- -y --profile minimal --default-toolchain stable + echo "$HOME/.cargo/bin" >> "$GITHUB_PATH" + export PATH="$HOME/.cargo/bin:$PATH" + fi + rustup toolchain install stable --profile minimal + rustup default stable + rustup target add "${{ matrix.target }}" - name: Build & upload binaries uses: taiki-e/upload-rust-binary-action@v1 with: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e054d6b..4b243eb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -60,9 +60,27 @@ jobs: needs: [check-runners] runs-on: ${{ fromJson(needs.check-runners.outputs.runner) }} if: github.event.pull_request.draft == false + env: + RUST_BACKTRACE: "1" steps: - uses: actions/checkout@v4 - - uses: jdx/mise-action@v4 + # Set up the Rust toolchain directly instead of via mise. The self-hosted + # `build` runners don't ship rustup, so mise's `rust = "stable"` silently + # no-ops there and `cargo` ends up missing (`cargo: command not found`). + # Install rustup when absent, then pin stable with the components fmt/clippy need. + - name: Set up Rust toolchain + shell: bash + run: | + set -euo pipefail + if ! command -v rustup >/dev/null 2>&1; then + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \ + | sh -s -- -y --profile minimal --default-toolchain stable + echo "$HOME/.cargo/bin" >> "$GITHUB_PATH" + export PATH="$HOME/.cargo/bin:$PATH" + fi + rustup toolchain install stable --profile minimal + rustup default stable + rustup component add rustfmt clippy - uses: Swatinem/rust-cache@v2 - name: fmt run: cargo fmt --all -- --check