Skip to content

Commit

Permalink
CI: use setup-python's built in pip dependency caching
Browse files Browse the repository at this point in the history
Simplify the workflow by specifying caching though setup-python's
with-arguments.

Signed-off-by: Joshua Lock <[email protected]>
  • Loading branch information
joshuagl committed Nov 16, 2022
1 parent d082614 commit fb06b51
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,8 @@ jobs:
uses: actions/setup-python@13ae5bb136fac2878aff31522b9efb785519f984
with:
python-version: ${{ matrix.python-version }}

- name: Find pip cache dir
id: pip-cache
run: echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT

- name: pip cache
uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7
with:
# Use the os dependent pip cache directory found above
path: ${{ steps.pip-cache.outputs.dir }}
# A match with 'key' counts as cache hit
key: ${{ runner.os }}-pip-${{ hashFiles('requirements*.txt') }}
# A match with 'restore-keys' is used as fallback
restore-keys: ${{ runner.os }}-pip-
cache: "pip"
cache-dependency-path: "requirements*.txt"

- name: Install dependencies
run: |
Expand Down

0 comments on commit fb06b51

Please sign in to comment.