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
+13 -16
View File
@@ -9,25 +9,23 @@ on:
jobs: jobs:
build: build:
name: Cargo build (clawstor-cached) name: Cargo build (clawstor-cached)
runs-on: ubuntu-latest runs-on: ubuntu-latest # host runner — cargo/cmake pre-installed
steps: steps:
- uses: actions/checkout@v4 - 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: | run: |
apt-get update echo "$HOME/.cargo/bin" >> $GITHUB_PATH
apt-get install -y --no-install-recommends \ for bin in rustc cargo cmake pkg-config; do
cmake build-essential pkg-config if ! command -v $bin >/dev/null 2>&1; then
echo "::error::$bin not found on PATH"
- name: Ensure rustup toolchain matches rust-toolchain.toml exit 1
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"
fi fi
# rustup will honour rust-toolchain.toml on next invocation $bin --version | head -1
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH" done
- name: Build with clawstor cache - name: Build with clawstor cache
id: cache id: cache
@@ -35,8 +33,7 @@ jobs:
with: with:
workspace: '.' workspace: '.'
profile: 'dev' profile: 'dev'
# On main-branch pushes we populate the cache; on PRs we # Read-only from forks so a malicious PR can't poison the cache.
# read-only to avoid a fork poisoning the cache.
no-upload: ${{ github.event_name == 'pull_request' }} no-upload: ${{ github.event_name == 'pull_request' }}
- name: Announce outcome - name: Announce outcome