Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: cache pip installs #1057

Merged
merged 4 commits into from
Feb 7, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/workflows/style.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ jobs:
uses: actions/[email protected]
with:
python-version: '3.10'
cache: 'pip'
cache-dependency-path: 'requirements/style.txt'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have to do anything to skip the pip install after this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fun. It looks like cache only caches downloads, not installs. Compared to develop, avoiding these downloads shaves 25 secs off the "Install pip dependencies" step, but adds 35 secs to the "Set up python" step because it has to download and unpack the cache.

- name: Install pip dependencies
run: |
pip install -r requirements/style.txt
Expand All @@ -35,6 +37,8 @@ jobs:
uses: actions/[email protected]
with:
python-version: '3.10'
cache: 'pip'
cache-dependency-path: 'requirements/style.txt'
- name: Install pip dependencies
run: |
pip install -r requirements/style.txt
Expand All @@ -51,6 +55,8 @@ jobs:
uses: actions/[email protected]
with:
python-version: '3.10'
cache: 'pip'
cache-dependency-path: 'requirements/style.txt'
- name: Install pip dependencies
run: |
pip install -r requirements/style.txt
Expand All @@ -67,6 +73,8 @@ jobs:
uses: actions/[email protected]
with:
python-version: '3.10'
cache: 'pip'
cache-dependency-path: 'requirements/style.txt'
- name: Install pip dependencies
run: |
pip install -r requirements/style.txt
Expand All @@ -83,6 +91,8 @@ jobs:
uses: actions/[email protected]
with:
python-version: '3.10'
cache: 'pip'
cache-dependency-path: 'requirements/style.txt'
- name: Install pip dependencies
run: |
pip install -r requirements/style.txt
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ jobs:
uses: actions/[email protected]
with:
python-version: '3.10'
cache: 'pip'
cache-dependency-path: |
requirements/required.txt
requirements/datasets.txt
requirements/tests.txt
- name: Install pip dependencies
run: |
pip install -r requirements/required.txt -r requirements/datasets.txt -r requirements/tests.txt
Expand All @@ -41,6 +46,11 @@ jobs:
uses: actions/[email protected]
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: |
requirements/required.txt
requirements/datasets.txt
requirements/tests.txt
- name: Setup headless display for pyvista
uses: pyvista/setup-headless-display-action@v1
- name: Install apt dependencies (Linux)
Expand Down Expand Up @@ -84,6 +94,10 @@ jobs:
uses: actions/[email protected]
with:
python-version: '3.8'
cache: 'pip'
cache-dependecy-path: |
requirements/min-reqs.old
requirements/min-cons.old
- name: Install apt dependencies (Linux)
run: |
sudo apt-get update
Expand Down