diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index f6903d1..eb35270 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -47,8 +47,18 @@ jobs: # nasm, file and desktop-file-validate may be installed by the runner's # administrator in ~/.local/bin, outside the session PATH. When they # are missing there, the pipeline falls back on what the system provides. - if [ -d "$HOME/.local/bin" ]; then - echo "PATH=$HOME/.local/bin:$PATH" >> "$GITHUB_ENV" + # rustup's ~/.cargo/bin likewise: the runner service does not always + # read the profile that adds it. + path="$PATH" + for dir in "$HOME/.local/bin" "${CARGO_HOME:-$HOME/.cargo}/bin"; do + if [ -d "$dir" ]; then + path="$dir:$path" + fi + done + echo "PATH=$path" >> "$GITHUB_ENV" + if ! PATH="$path" command -v cargo >/dev/null; then + echo "cargo not found (HOME=$HOME, PATH=$path): install rustup for the runner's user" >&2 + exit 1 fi - name: Versions diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 01a28bf..484cb49 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -46,8 +46,18 @@ jobs: # nasm, file and desktop-file-validate may be installed by the runner's # administrator in ~/.local/bin, outside the session PATH. When they # are missing there, the pipeline falls back on what the system provides. - if [ -d "$HOME/.local/bin" ]; then - echo "PATH=$HOME/.local/bin:$PATH" >> "$GITHUB_ENV" + # rustup's ~/.cargo/bin likewise: the runner service does not always + # read the profile that adds it. + path="$PATH" + for dir in "$HOME/.local/bin" "${CARGO_HOME:-$HOME/.cargo}/bin"; do + if [ -d "$dir" ]; then + path="$dir:$path" + fi + done + echo "PATH=$path" >> "$GITHUB_ENV" + if ! PATH="$path" command -v cargo >/dev/null; then + echo "cargo not found (HOME=$HOME, PATH=$path): install rustup for the runner's user" >&2 + exit 1 fi - name: Version and tag