Skip to content

Commit

Permalink
add cargo caching
Browse files Browse the repository at this point in the history
  • Loading branch information
apparebit committed Oct 16, 2024
1 parent 353ad04 commit 82b5b33
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ jobs:
os: ['ubuntu-latest', 'windows-latest', 'macos-latest']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
Expand All @@ -39,6 +40,20 @@ jobs:
python -m pip install --upgrade pip
pip install matplotlib maturin
- name: Set up Rust caching
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
${{ runner.os }}-cargo
- name: Set up stable Rust
run: rustup toolchain install stable

Expand Down Expand Up @@ -220,7 +235,9 @@ jobs:
release:
name: Release
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
if: |
startsWith(github.ref, 'refs/tags/') &&
github.repository == 'apparebit/prettypretty'
needs: [linux, musllinux, windows, macos, sdist]
permissions:
id-token: write
Expand Down

0 comments on commit 82b5b33

Please sign in to comment.