Skip to content

Commit

Permalink
cache Python dependencies for CI (#1623)
Browse files Browse the repository at this point in the history
  • Loading branch information
oskooi authored Jun 21, 2021
1 parent ff405c6 commit 8903b50
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
19 changes: 17 additions & 2 deletions .github/workflows/build-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,26 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Get pip cache dir
id: pip-cache
run: |
python -m pip install --upgrade pip wheel
echo "::set-output name=dir::$(pip cache dir)"
- name: pip cache
uses: actions/cache@v2
id: cache
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-py${{ matrix.python-version }}-mpi-${{ matrix.enable-mpi }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: ${{ runner.os }}-py${{ matrix.python-version }}-mpi-${{ matrix.enable-mpi }}-pip-

- name: Install Python dependencies
run: pip install autograd h5py jax jaxlib matplotlib numpy parameterized pytest scipy
if: steps.cache.outputs.cache-hit != 'true'
run: pip install -r python/requirements.txt

- name: Install mpi4py
if: matrix.enable-mpi
if: ${{ matrix.enable-mpi && steps.cache.outputs.cache-hit != true }}
run: pip install mpi4py

- name: Run autoreconf
Expand Down
9 changes: 9 additions & 0 deletions python/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
autograd
h5py
jax
jaxlib
matplotlib
numpy
parameterized
pytest
scipy

0 comments on commit 8903b50

Please sign in to comment.