Skip to content

Commit d892384

Browse files
committed
Cache dependencies, although the gain is insignificant for this repo
1 parent 274cc00 commit d892384

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

.github/workflows/python-package.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,20 @@ jobs:
3030
uses: actions/setup-python@v2
3131
with:
3232
python-version: ${{ matrix.python-version }}
33+
34+
# Derived from https://github.com/actions/cache/blob/main/examples.md#using-pip-to-get-cache-location
35+
# However, a before-and-after test shows no improvement in this repo,
36+
# possibly because the bottlenect was not in downloading those small python deps.
37+
- name: Get pip cache dir from pip 20.1+
38+
id: pip-cache
39+
run: |
40+
echo "::set-output name=dir::$(pip cache dir)"
41+
- name: pip cache
42+
uses: actions/cache@v2
43+
with:
44+
path: ${{ steps.pip-cache.outputs.dir }}
45+
key: ${{ runner.os }}-py${{ matrix.python-version }}-pip-${{ hashFiles('**/setup.py', '**/requirements.txt') }}
46+
3347
- name: Install dependencies
3448
run: |
3549
python -m pip install --upgrade pip

0 commit comments

Comments
 (0)