refactor: cache rust toolchain & cargo dirs for ci devel workflow (#300)
Diff
.github/workflows/devel.yml | 32 ++++++++++++++++++++------------
1 file changed, 20 insertions(+), 12 deletions(-)
@@ -28,6 +28,7 @@ jobs:
name: test
runs-on: ${{ matrix.os }}
env:
CARGO_BIN: cargo
TARGET_FLAGS: ""
@@ -41,8 +42,6 @@ jobs:
matrix:
build:
- pinned
- stable
- beta
- linux-musl
- linux-musl-arm64
- linux-musl-i686
@@ -66,16 +65,11 @@ jobs:
- windows-msvc-arm64
- windows-pc-gnu
include:
- build: pinned
os: ubuntu-22.04
rust: 1.70.0
- build: stable
os: ubuntu-22.04
rust: stable
- build: beta
os: ubuntu-22.04
rust: beta
- build: linux-musl
@@ -165,10 +159,24 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Cache Rust Cargo/Toolchain
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/.rustup
**/target
key: rust-${{ matrix.build }}-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
rust-${{ matrix.build }}-${{ matrix.target }}-
- name: Install Linux/BSD tools
if: ${{ !contains(matrix.os, 'windows') }}
run: scripts/ci/install_tools.sh --target=${{ matrix.target }}
@@ -187,7 +195,7 @@ jobs:
if [[ "${{ matrix.build }}" == "linux-android-armv7" ]] || [[ "${{ matrix.build }}" == "linux-android-arm64" ]]; then
echo "CARGO_BIN=scripts/ci/cargo.sh" >> $GITHUB_ENV
else
cargo install cross@^0.2
cargo install --force cross@^0.2
echo "CARGO_BIN=cross" >> $GITHUB_ENV
fi
@@ -247,7 +255,7 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 1