Skip to content

Commit

Permalink
Enable pip caching for GitHub Actions
Browse files Browse the repository at this point in the history
Enable pip caching in order to avoid repeatedly rebuilding all
the PyPy wheels for source packages.  This is inspired by discussion
in psf/requests#6496 and it may help with
the PyPy CI failures.
  • Loading branch information
mgorny committed Aug 13, 2023
1 parent c62ab87 commit e42c958
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,21 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
# from https://github.com/actions/cache/blob/main/examples.md#python---pip
- name: Get pip cache dir
id: pip-cache
shell: bash
run: |
echo "name=$(pip cache dir)" >> $GITHUB_OUTPUT
- name: pip cache
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
# the action does not permit updating an existing cache, so we need
# unique keys
key: ${{ runner.os }}-${{ matrix.python-version }}-pip-${{ github.sha }}
restore-keys: |
${{ runner.os }}-${{ matrix.python-version }}-pip-
- name: Install dependencies
run: |
python -m pip install .
Expand Down

0 comments on commit e42c958

Please sign in to comment.