Use preinstalled Rust binaries in CI
This commit is contained in:
+28
-18
@@ -22,17 +22,22 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: Check Rust toolchain is preinstalled
|
- name: Use preinstalled Rust toolchain
|
||||||
run: |
|
run: |
|
||||||
rustup --version
|
set -eu
|
||||||
rustup toolchain list
|
toolchain_dir="${RUSTUP_HOME:-$HOME/.rustup}/toolchains/1.85.0-x86_64-unknown-linux-gnu"
|
||||||
rustup toolchain list | grep -F '1.85.0' >/dev/null || {
|
toolchain_bin="$toolchain_dir/bin"
|
||||||
echo 'Rust 1.85.0 is not installed in the Gitea runner image.' >&2
|
if [ ! -x "$toolchain_bin/rustc" ] || [ ! -x "$toolchain_bin/cargo" ]; then
|
||||||
echo 'Install it on the runner image/host before running CI:' >&2
|
echo "Rust 1.85.0 is not preinstalled at $toolchain_dir." >&2
|
||||||
echo 'rustup toolchain install 1.85.0 --profile minimal --component clippy --component rustfmt' >&2
|
echo "Install it in the Gitea runner image/host before running CI:" >&2
|
||||||
|
echo "rustup toolchain install 1.85.0 --profile minimal --component clippy --component rustfmt" >&2
|
||||||
exit 1
|
exit 1
|
||||||
}
|
fi
|
||||||
rustup component list --toolchain 1.85.0 --installed
|
printf '%s\n' "$toolchain_bin" >> "$GITHUB_PATH"
|
||||||
|
"$toolchain_bin/rustc" --version
|
||||||
|
"$toolchain_bin/cargo" --version
|
||||||
|
"$toolchain_bin/rustfmt" --version
|
||||||
|
"$toolchain_bin/cargo-clippy" --version
|
||||||
|
|
||||||
- name: Verify runner toolchain
|
- name: Verify runner toolchain
|
||||||
run: |
|
run: |
|
||||||
@@ -116,17 +121,22 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: Check Rust toolchain is preinstalled
|
- name: Use preinstalled Rust toolchain
|
||||||
run: |
|
run: |
|
||||||
rustup --version
|
set -eu
|
||||||
rustup toolchain list
|
toolchain_dir="${RUSTUP_HOME:-$HOME/.rustup}/toolchains/1.85.0-x86_64-unknown-linux-gnu"
|
||||||
rustup toolchain list | grep -F '1.85.0' >/dev/null || {
|
toolchain_bin="$toolchain_dir/bin"
|
||||||
echo 'Rust 1.85.0 is not installed in the Gitea runner image.' >&2
|
if [ ! -x "$toolchain_bin/rustc" ] || [ ! -x "$toolchain_bin/cargo" ]; then
|
||||||
echo 'Install it on the runner image/host before running CI:' >&2
|
echo "Rust 1.85.0 is not preinstalled at $toolchain_dir." >&2
|
||||||
echo 'rustup toolchain install 1.85.0 --profile minimal --component clippy --component rustfmt' >&2
|
echo "Install it in the Gitea runner image/host before running CI:" >&2
|
||||||
|
echo "rustup toolchain install 1.85.0 --profile minimal --component clippy --component rustfmt" >&2
|
||||||
exit 1
|
exit 1
|
||||||
}
|
fi
|
||||||
rustup component list --toolchain 1.85.0 --installed
|
printf '%s\n' "$toolchain_bin" >> "$GITHUB_PATH"
|
||||||
|
"$toolchain_bin/rustc" --version
|
||||||
|
"$toolchain_bin/cargo" --version
|
||||||
|
"$toolchain_bin/rustfmt" --version
|
||||||
|
"$toolchain_bin/cargo-clippy" --version
|
||||||
|
|
||||||
- name: Verify runner toolchain
|
- name: Verify runner toolchain
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -22,17 +22,22 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: Check Rust toolchain is preinstalled
|
- name: Use preinstalled Rust toolchain
|
||||||
run: |
|
run: |
|
||||||
rustup --version
|
set -eu
|
||||||
rustup toolchain list
|
toolchain_dir="${RUSTUP_HOME:-$HOME/.rustup}/toolchains/1.85.0-x86_64-unknown-linux-gnu"
|
||||||
rustup toolchain list | grep -F '1.85.0' >/dev/null || {
|
toolchain_bin="$toolchain_dir/bin"
|
||||||
echo 'Rust 1.85.0 is not installed in the Gitea runner image.' >&2
|
if [ ! -x "$toolchain_bin/rustc" ] || [ ! -x "$toolchain_bin/cargo" ]; then
|
||||||
echo 'Install it on the runner image/host before running CI:' >&2
|
echo "Rust 1.85.0 is not preinstalled at $toolchain_dir." >&2
|
||||||
echo 'rustup toolchain install 1.85.0 --profile minimal --component clippy --component rustfmt' >&2
|
echo "Install it in the Gitea runner image/host before running CI:" >&2
|
||||||
|
echo "rustup toolchain install 1.85.0 --profile minimal --component clippy --component rustfmt" >&2
|
||||||
exit 1
|
exit 1
|
||||||
}
|
fi
|
||||||
rustup component list --toolchain 1.85.0 --installed
|
printf '%s\n' "$toolchain_bin" >> "$GITHUB_PATH"
|
||||||
|
"$toolchain_bin/rustc" --version
|
||||||
|
"$toolchain_bin/cargo" --version
|
||||||
|
"$toolchain_bin/rustfmt" --version
|
||||||
|
"$toolchain_bin/cargo-clippy" --version
|
||||||
|
|
||||||
- name: Verify runner toolchain
|
- name: Verify runner toolchain
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
Reference in New Issue
Block a user