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

Use a new caching strategy for the CI #717

Merged
merged 2 commits into from
Jul 21, 2022
Merged
Changes from all 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
27 changes: 18 additions & 9 deletions .github/workflows/continuous_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,23 +112,32 @@ jobs:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Set ENV VARS
run: |
echo "POETRY_VERSION=$(poetry --version)" >> $GITHUB_ENV

#----------------------------------------------
# cache the directory where poetry caches packages
#----------------------------------------------
- name: Cache Poetry cache
uses: actions/cache@v2
with:
path: ~/.cache/pypoetry
key: poetry-cache-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ env.POETRY_VERSION }}

#----------------------------------------------
# load cached venv if cache exists
# cache the directory where pip caches packages
#----------------------------------------------
- name: Set up Poetry cache for Python dependencies
id: cached-poetry-dependencies
# uses: actions/cache@v2
uses: pat-s/always-upload-cache@v2
- name: Cache Pip cache
uses: actions/cache@v2
with:
path: .venv
key: venvEM2-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
path: ~/.cache/pip
key: pip-cache-${{ runner.os }}-${{ env.PYTHON_VERSION }}

#----------------------------------------------
# install dependencies if cache does not exist
# --------- install dependencies --------
#----------------------------------------------
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: |
poetry install -E ci --no-interaction --no-root
poetry run pip install torch --extra-index-url https://download.pytorch.org/whl/cpu
Expand Down