Skip to content

Commit

Permalink
CI: cache pip installs (#1057)
Browse files Browse the repository at this point in the history
* CI: cache pip installs

* Update to new min deps filename

* Use cache action instead

* Cache releases too
  • Loading branch information
adamjstewart authored and calebrob6 committed Apr 10, 2023
1 parent 09022f4 commit 686c1cc
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 2 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,14 @@ jobs:
uses: actions/[email protected]
with:
python-version: '3.10'
- name: Cache dependencies
uses: actions/[email protected]
id: cache
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('setup.cfg') }}
- name: Install pip dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
pip install .[tests]
pip list
Expand All @@ -33,7 +40,14 @@ jobs:
uses: actions/[email protected]
with:
python-version: '3.10'
- name: Cache dependencies
uses: actions/[email protected]
id: cache
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('setup.cfg') }}
- name: Install pip dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
pip install .[datasets,tests]
pip list
Expand All @@ -49,7 +63,14 @@ jobs:
uses: actions/[email protected]
with:
python-version: '3.10'
- name: Cache dependencies
uses: actions/[email protected]
id: cache
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('setup.cfg') }}
- name: Install pip dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
pip install .[datasets,docs,tests]
pip list
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/style.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,14 @@ jobs:
uses: actions/[email protected]
with:
python-version: '3.10'
- name: Cache dependencies
uses: actions/[email protected]
id: cache
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('requirements/style.txt') }}
- name: Install pip dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
pip install -r requirements/style.txt
pip list
Expand All @@ -35,7 +42,14 @@ jobs:
uses: actions/[email protected]
with:
python-version: '3.10'
- name: Cache dependencies
uses: actions/[email protected]
id: cache
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('requirements/style.txt') }}
- name: Install pip dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
pip install -r requirements/style.txt
pip list
Expand All @@ -51,7 +65,14 @@ jobs:
uses: actions/[email protected]
with:
python-version: '3.10'
- name: Cache dependencies
uses: actions/[email protected]
id: cache
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('requirements/style.txt') }}
- name: Install pip dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
pip install -r requirements/style.txt
pip list
Expand All @@ -67,7 +88,14 @@ jobs:
uses: actions/[email protected]
with:
python-version: '3.10'
- name: Cache dependencies
uses: actions/[email protected]
id: cache
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('requirements/style.txt') }}
- name: Install pip dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
pip install -r requirements/style.txt
pip list
Expand All @@ -83,7 +111,14 @@ jobs:
uses: actions/[email protected]
with:
python-version: '3.10'
- name: Cache dependencies
uses: actions/[email protected]
id: cache
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('requirements/style.txt') }}
- name: Install pip dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
pip install -r requirements/style.txt
pip list
Expand Down
25 changes: 23 additions & 2 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,14 @@ jobs:
uses: actions/[email protected]
with:
python-version: '3.10'
- name: Cache dependencies
uses: actions/[email protected]
id: cache
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('requirements/required.txt') }}-${{ hashFiles('requirements/datasets.txt') }}-${{ hashFiles('requirements/tests.txt') }}
- name: Install pip dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
pip install -r requirements/required.txt -r requirements/datasets.txt -r requirements/tests.txt
pip list
Expand All @@ -44,6 +51,12 @@ jobs:
uses: actions/[email protected]
with:
python-version: ${{ matrix.python-version }}
- name: Cache dependencies
uses: actions/[email protected]
id: cache
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('requirements/required.txt') }}-${{ hashFiles('requirements/datasets.txt') }}-${{ hashFiles('requirements/tests.txt') }}
- name: Setup headless display for pyvista
uses: pyvista/setup-headless-display-action@v1
- name: Install apt dependencies (Linux)
Expand All @@ -60,7 +73,8 @@ jobs:
set "PATH=%PATH%;c:\msys64\usr\bin"
pacman -S --noconfirm --needed unrar
if: ${{ runner.os == 'Windows' }}
- name: Install pip dependencies (3.8+)
- name: Install pip dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
pip install -r requirements/required.txt -r requirements/datasets.txt -r requirements/tests.txt
pip list
Expand Down Expand Up @@ -94,12 +108,19 @@ jobs:
- name: Set up python
uses: actions/[email protected]
with:
python-version: '3.7'
python-version: '3.8'
- name: Cache dependencies
uses: actions/[email protected]
id: cache
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('requirements/min-reqs.old') }}-${{ hashFiles('requirements/mins-cons.old') }}
- name: Install apt dependencies (Linux)
run: |
sudo apt-get update
sudo apt-get install libgeos-dev libhdf5-dev unrar
- name: Install pip dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
pip install cython numpy==1.17.2 # needed by pycocotools
pip install -r requirements/min-reqs.old -c requirements/min-cons.old
Expand Down

0 comments on commit 686c1cc

Please sign in to comment.