fix: install rust via rustup in workflow
All checks were successful
Rust Build Cache Test / build (push) Successful in 3m40s
All checks were successful
Rust Build Cache Test / build (push) Successful in 3m40s
This commit is contained in:
@@ -17,12 +17,16 @@ jobs:
|
||||
- name: Checkout code
|
||||
uses: https://gitea.com/actions/checkout@v4
|
||||
|
||||
- name: Install Rust
|
||||
run: |
|
||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable
|
||||
source "$HOME/.cargo/env"
|
||||
|
||||
- name: Get Cargo lock hash
|
||||
id: hash
|
||||
run: |
|
||||
source "$HOME/.cargo/env"
|
||||
echo "hash=$(cat Cargo.lock Cargo.toml | sha256sum | cut -d' ' -f1)" >> $GITHUB_OUTPUT
|
||||
echo "=== Manifest hash ==="
|
||||
echo "${{ env.hash }}"
|
||||
|
||||
- name: Cache cargo
|
||||
uses: https://gitea.com/actions/cache@v3
|
||||
@@ -37,21 +41,26 @@ jobs:
|
||||
|
||||
- name: Show cache info (before build)
|
||||
run: |
|
||||
source "$HOME/.cargo/env"
|
||||
echo "=== Cache Key ==="
|
||||
echo "rust-${{ runner.os }}-${{ steps.hash.outputs.hash }}"
|
||||
echo ""
|
||||
echo "=== Cargo cache directories (before build) ==="
|
||||
du -sh ~/.cargo/registry ~/.cargo/git target 2>/dev/null || echo "Dirs not yet present"
|
||||
echo ""
|
||||
echo "=== Cargo version ==="
|
||||
echo "=== Cargo/Rust versions ==="
|
||||
cargo --version
|
||||
rustc --version
|
||||
|
||||
- name: Build
|
||||
run: cargo build --verbose
|
||||
run: |
|
||||
source "$HOME/.cargo/env"
|
||||
cargo build --verbose
|
||||
|
||||
- name: Run
|
||||
run: cargo run
|
||||
run: |
|
||||
source "$HOME/.cargo/env"
|
||||
cargo run
|
||||
|
||||
- name: Check cache after build
|
||||
run: |
|
||||
|
||||
Reference in New Issue
Block a user