[chore](trx-rs): fix Rust PATH handling in CI
CI / lint (pull_request) Failing after 3m18s
CI / reuse (pull_request) Has been cancelled
CI / test (pull_request) Has been cancelled

The Set up Rust step wrote the cargo bin dir to GITHUB_PATH, which does
not help within the same step and is not relied upon across steps on the
Gitea act_runner. Prepend $HOME/.cargo/bin to PATH directly in the setup
and each cargo step instead, so rustup and cargo resolve regardless of
GITHUB_PATH support.

Assisted-By: Claude Code (claude-opus-4)
Claude-Session: https://claude.ai/code/session_01NFpGtGTWUEYXLwZeZs2RAV
Signed-off-by: Stan Grams <sjg@haxx.space>
This commit is contained in:
sjg
2026-07-17 23:25:21 +02:00
parent bcde03de38
commit c7470acc1c
+14 -6
View File
@@ -27,10 +27,10 @@ jobs:
- name: Set up Rust - name: Set up Rust
run: | run: |
export PATH="$HOME/.cargo/bin:$PATH"
if ! command -v rustup >/dev/null 2>&1; then if ! command -v rustup >/dev/null 2>&1; then
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \
| sh -s -- -y --profile minimal | sh -s -- -y --profile minimal
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
fi fi
rustup toolchain install stable --profile minimal \ rustup toolchain install stable --profile minimal \
--component rustfmt --component clippy --component rustfmt --component clippy
@@ -47,10 +47,14 @@ jobs:
restore-keys: cargo-${{ runner.os }}- restore-keys: cargo-${{ runner.os }}-
- name: rustfmt - name: rustfmt
run: cargo fmt --all -- --check run: |
export PATH="$HOME/.cargo/bin:$PATH"
cargo fmt --all -- --check
- name: clippy - name: clippy
run: cargo clippy --workspace --all-targets --all-features -- -D warnings run: |
export PATH="$HOME/.cargo/bin:$PATH"
cargo clippy --workspace --all-targets --all-features -- -D warnings
test: test:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -66,10 +70,10 @@ jobs:
- name: Set up Rust - name: Set up Rust
run: | run: |
export PATH="$HOME/.cargo/bin:$PATH"
if ! command -v rustup >/dev/null 2>&1; then if ! command -v rustup >/dev/null 2>&1; then
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \
| sh -s -- -y --profile minimal | sh -s -- -y --profile minimal
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
fi fi
rustup toolchain install stable --profile minimal rustup toolchain install stable --profile minimal
rustup default stable rustup default stable
@@ -85,10 +89,14 @@ jobs:
restore-keys: cargo-${{ runner.os }}- restore-keys: cargo-${{ runner.os }}-
- name: Build - name: Build
run: cargo build --workspace --all-targets --locked run: |
export PATH="$HOME/.cargo/bin:$PATH"
cargo build --workspace --all-targets --locked
- name: Test - name: Test
run: cargo test --workspace --locked run: |
export PATH="$HOME/.cargo/bin:$PATH"
cargo test --workspace --locked
reuse: reuse:
runs-on: ubuntu-latest runs-on: ubuntu-latest