[chore](trx-rs): fix Rust PATH handling in CI
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:
+14
-6
@@ -27,10 +27,10 @@ jobs:
|
||||
|
||||
- name: Set up Rust
|
||||
run: |
|
||||
export PATH="$HOME/.cargo/bin:$PATH"
|
||||
if ! command -v rustup >/dev/null 2>&1; then
|
||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \
|
||||
| sh -s -- -y --profile minimal
|
||||
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
|
||||
fi
|
||||
rustup toolchain install stable --profile minimal \
|
||||
--component rustfmt --component clippy
|
||||
@@ -47,10 +47,14 @@ jobs:
|
||||
restore-keys: cargo-${{ runner.os }}-
|
||||
|
||||
- name: rustfmt
|
||||
run: cargo fmt --all -- --check
|
||||
run: |
|
||||
export PATH="$HOME/.cargo/bin:$PATH"
|
||||
cargo fmt --all -- --check
|
||||
|
||||
- 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:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -66,10 +70,10 @@ jobs:
|
||||
|
||||
- name: Set up Rust
|
||||
run: |
|
||||
export PATH="$HOME/.cargo/bin:$PATH"
|
||||
if ! command -v rustup >/dev/null 2>&1; then
|
||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \
|
||||
| sh -s -- -y --profile minimal
|
||||
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
|
||||
fi
|
||||
rustup toolchain install stable --profile minimal
|
||||
rustup default stable
|
||||
@@ -85,10 +89,14 @@ jobs:
|
||||
restore-keys: cargo-${{ runner.os }}-
|
||||
|
||||
- name: Build
|
||||
run: cargo build --workspace --all-targets --locked
|
||||
run: |
|
||||
export PATH="$HOME/.cargo/bin:$PATH"
|
||||
cargo build --workspace --all-targets --locked
|
||||
|
||||
- name: Test
|
||||
run: cargo test --workspace --locked
|
||||
run: |
|
||||
export PATH="$HOME/.cargo/bin:$PATH"
|
||||
cargo test --workspace --locked
|
||||
|
||||
reuse:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
Reference in New Issue
Block a user