Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Use cache action to avoid cross double install #63

Merged
merged 1 commit into from
Jun 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 23 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,23 @@ env:
CARGO_TERM_COLOR: always

jobs:
install_dependencies:
runs-on: ubuntu-20.04
steps:

- name: Install cross
run: cargo install cross --git https://github.com/cross-rs/cross

- name: Cache dependencies
uses: actions/cache@v4.0.2
with:
path: ~/.cargo/bin
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-

build_and_test:
needs: install_dependencies
runs-on: ubuntu-20.04
permissions:
contents: write
Expand All @@ -24,8 +40,13 @@ jobs:
steps:
- uses: actions/checkout@v4.1.1

- name: Install cross
run: cargo install cross --git https://github.com/cross-rs/cross
- name: Restore dependencies from cache
uses: actions/cache@v4.0.2
with:
path: ~/.cargo/bin
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-

- name: Test
run: cross test --target ${{ matrix.target }}
Expand Down