Navigation Menu

Skip to content

Commit

Permalink
Add cache for CI
Browse files Browse the repository at this point in the history
  • Loading branch information
sanders41 committed Sep 18, 2021
1 parent 0495f62 commit 3574698
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 13 deletions.
30 changes: 26 additions & 4 deletions .github/workflows/testing.yaml
Expand Up @@ -20,9 +20,20 @@ jobs:
run: |
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
echo "${HOME}/.poetry/bin" >> $GITHUB_PATH
- name: Install Dependencies
- name: Configure poetry
run: |
poetry install
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: Cache poetry venv
uses: actions/cache@v2
id: poetry-cache
with:
path: .venv
key: venv-${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
restore-keys: venv-${{ runner.os }}-poetry-
- name: Install Dependencies
if: steps.poetry-cache.outputs.cache-hit != 'true'
run: poetry install
- name: Isort check
run: |
poetry run isort tests --check-only
Expand Down Expand Up @@ -52,9 +63,20 @@ jobs:
run: |
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
echo "${HOME}/.poetry/bin" >> $GITHUB_PATH
- name: "Install Dependencies"
- name: Configure poetry
run: |
poetry install
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: Cache poetry venv
uses: actions/cache@v2
id: poetry-cache
with:
path: .venv
key: venv-${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
restore-keys: venv-${{ runner.os }}-poetry-
- name: Install Dependencies
if: steps.poetry-cache.outputs.cache-hit != 'true'
run: poetry install
- name: Test with pytest
run: |
poetry run pytest
31 changes: 26 additions & 5 deletions {{cookiecutter.project_slug}}/actions/testing_all_os.yaml
Expand Up @@ -20,9 +20,20 @@ jobs:
run: |
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
echo "${HOME}/.poetry/bin" >> $GITHUB_PATH
- name: Install Dependencies
- name: Configure poetry
run: |
poetry install
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: Cache poetry venv
uses: actions/cache@v2
id: poetry-cache
with:
path: .venv
key: venv-${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
restore-keys: venv-${{ runner.os }}-poetry-
- name: Install Dependencies
if: steps.poetry-cache.outputs.cache-hit != 'true'
run: poetry install
- name: Isort check
run: |
poetry run isort {{ cookiecutter.source_dir }} tests --check-only
Expand All @@ -38,7 +49,6 @@ jobs:
- name: mypy check
run: |
poetry run mypy {{ cookiecutter.source_dir }}
testing:
strategy:
fail-fast: false
Expand All @@ -62,9 +72,20 @@ jobs:
run: |
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
echo "${HOME}/.poetry/bin" >> $GITHUB_PATH
- name: Install Dependencies
- name: Configure poetry
run: |
poetry install
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: Cache poetry venv
uses: actions/cache@v2
id: poetry-cache
with:
path: .venv
key: venv-${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
restore-keys: venv-${{ runner.os }}-poetry-
- name: Install Dependencies
if: steps.poetry-cache.outputs.cache-hit != 'true'
run: poetry install
- name: Test with pytest
run: |
poetry run pytest
30 changes: 26 additions & 4 deletions {{cookiecutter.project_slug}}/actions/testing_linux_only.yaml
Expand Up @@ -20,9 +20,20 @@ jobs:
run: |
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
echo "${HOME}/.poetry/bin" >> $GITHUB_PATH
- name: Install Dependencies
- name: Configure poetry
run: |
poetry install
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: Cache poetry venv
uses: actions/cache@v2
id: poetry-cache
with:
path: .venv
key: venv-${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
restore-keys: venv-${{ runner.os }}-poetry-
- name: Install Dependencies
if: steps.poetry-cache.outputs.cache-hit != 'true'
run: poetry install
- name: Isort check
run: |
poetry run isort {{ cookiecutter.source_dir }} tests --check-only
Expand Down Expand Up @@ -55,9 +66,20 @@ jobs:
run: |
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
echo "${HOME}/.poetry/bin" >> $GITHUB_PATH
- name: Install Dependencies
- name: Configure poetry
run: |
poetry install
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: Cache poetry venv
uses: actions/cache@v2
id: poetry-cache
with:
path: .venv
key: venv-${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
restore-keys: venv-${{ runner.os }}-poetry-
- name: Install Dependencies
if: steps.poetry-cache.outputs.cache-hit != 'true'
run: poetry install
- name: Test with pytest
run: |
poetry run pytest

0 comments on commit 3574698

Please sign in to comment.