-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make our rust/pip cache a composite action (#8287)
* make our rust/pip cache a composite action * fixes
- Loading branch information
1 parent
030381a
commit 2bf2f2c
Showing
2 changed files
with
66 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Cache rust and pip | ||
description: Caches rust and pip data to speed builds | ||
inputs: | ||
additional-paths: | ||
description: 'Additional paths to add to the cache' | ||
required: false | ||
default: '' | ||
key: | ||
description: 'cache key' | ||
required: true | ||
outputs: | ||
cache-hit: | ||
description: 'Was the cache hit?' | ||
value: ${{ steps.cache.outputs.cache-hit }} | ||
|
||
|
||
runs: | ||
using: "composite" | ||
|
||
steps: | ||
- name: Get pip cache dir | ||
id: pip-cache | ||
run: | | ||
# Determine the path to our Python. It's in venv for our containers | ||
# but just standard $PATH for setup-python pythons. | ||
if [[ -f "/venv/bin/python" ]]; then | ||
echo "dir=$(/venv/bin/python -m pip cache dir)" >> $GITHUB_OUTPUT | ||
elif which python >/dev/null; then | ||
echo "dir=$(python -m pip cache dir)" >> $GITHUB_OUTPUT | ||
fi | ||
shell: bash | ||
- uses: actions/cache@v3.2.5 | ||
id: cache | ||
with: | ||
path: | | ||
${{ steps.pip-cache.outputs.dir }} | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/registry/src/ | ||
~/.cargo/git/db/ | ||
src/rust/target/ | ||
${{ inputs.additional-paths }} | ||
key: ${{ inputs.key }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters