workflow: drop apt/rustup install steps for host runner #32

Merged
osobh merged 1 commits from fix-workflow-no-sudo into main 2026-07-13 08:35:42 +00:00
Showing only changes of commit cb9d3d5180 - Show all commits
+13 -16
View File
@@ -9,25 +9,23 @@ on:
jobs:
build:
name: Cargo build (clawstor-cached)
runs-on: ubuntu-latest
runs-on: ubuntu-latest # host runner — cargo/cmake pre-installed
steps:
- uses: actions/checkout@v4
- name: Install system build deps
- name: Preflight tools + toolchain
# Host runner: cmake/gcc/pkg-config come from the OS,
# cargo/rustup come from the act_runner user's ~/.cargo/bin
# (already on PATH via systemd unit Environment=).
run: |
apt-get update
apt-get install -y --no-install-recommends \
cmake build-essential pkg-config
- name: Ensure rustup toolchain matches rust-toolchain.toml
run: |
if ! command -v rustup >/dev/null 2>&1; then
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \
| sh -s -- -y --profile minimal
. "$HOME/.cargo/env"
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
for bin in rustc cargo cmake pkg-config; do
if ! command -v $bin >/dev/null 2>&1; then
echo "::error::$bin not found on PATH"
exit 1
fi
# rustup will honour rust-toolchain.toml on next invocation
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
$bin --version | head -1
done
- name: Build with clawstor cache
id: cache
@@ -35,8 +33,7 @@ jobs:
with:
workspace: '.'
profile: 'dev'
# On main-branch pushes we populate the cache; on PRs we
# read-only to avoid a fork poisoning the cache.
# Read-only from forks so a malicious PR can't poison the cache.
no-upload: ${{ github.event_name == 'pull_request' }}
- name: Announce outcome