Skip to content

Commit 91a2f27

Browse files
Fix caching in CI (#262)
This fixes the caching for python dependencies in the CI by making pipenv install in a virtual environment and telling the setup-python action to cache this venv as it doesn't currently support the global pipenv cache. This increases the speed of some of the fast jobs (like the yapf format checker) quite a bit. Formatting went from about 2.5min to about 0.7min in my testing.
1 parent 2f68108 commit 91a2f27

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

.github/workflows/main.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,17 @@ jobs:
5252
uses: actions/setup-python@v4
5353
with:
5454
python-version: ${{ matrix.python-version }}
55-
cache: 'pip'
55+
cache: 'pipenv'
5656
cache-dependency-path: Pipfile.lock
5757
- name: Install Python, no cache
5858
if: needs.Envvars.outputs.do_cache == '0'
5959
uses: actions/setup-python@v4
6060
with:
6161
python-version: ${{ matrix.python-version }}
62-
- run: |
63-
pip3 install pipenv
64-
pipenv sync --categories="packages dev-packages ci" --system --verbose
62+
- name: Install Pipenv
63+
run: pip3 install pipenv
64+
- name: Install Python Dependencies
65+
run: pipenv sync --categories="packages dev-packages ci" --verbose
6566
- name: ${{ matrix.task }}
66-
run: ${{ matrix.cmd }}
67+
run: pipenv run ${{ matrix.cmd }}
68+

0 commit comments

Comments
 (0)