Skip to content

Commit b68f23e

Browse files
committed
Cache tox env in GH actions
1 parent 34ca4d1 commit b68f23e

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

.github/workflows/python-app.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,16 @@ jobs:
2525
python -m pip install --upgrade pip
2626
pip install poetry tox
2727
poetry install
28+
- name: Cache tox environments
29+
id: cache-tox
30+
uses: actions/cache@v1
31+
with:
32+
path: .tox
33+
# setup.cfg, pyproject.toml, and .pre-commit-config.yaml have
34+
# versioning info that would impact the tox environment. hashFiles
35+
# only takes a single file path or pattern at the moment.
36+
key: ${{ runner.os }}-${{ matrix.python }}-tox-${{ hashFiles('setup.cfg') }}-${{ hashFiles('pyproject.toml') }}
37+
38+
2839
- name: Run Tox
2940
run: tox -- --no-cov

0 commit comments

Comments
 (0)