Skip to content

Commit 9ce725d

Browse files
committed
Add caching .tox as well
1 parent 1bf86e6 commit 9ce725d

File tree

2 files changed

+20
-18
lines changed

2 files changed

+20
-18
lines changed

.github/workflows/release.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@ jobs:
88
name: Publish release to PyPI
99
runs-on: ubuntu-latest
1010
steps:
11-
- name: Checkout source code
11+
- name: Checkout repo
1212
uses: actions/checkout@v4
13-
- name: Restore cached virtualenv
13+
- name: Restore cached venv and .tox
1414
id: restore-venv-cache
1515
uses: actions/cache/restore@v4
1616
with:
17-
path: ./venv
17+
path: |
18+
./venv
19+
./.tox
1820
key: ${{ runner.os }}-3.9-venv-${{ hashFiles('**/pyproject.toml') }}
1921
- name: Build venv
2022
if: steps.restore-venv-cache.outputs.cache-hit != 'true'
@@ -41,9 +43,11 @@ jobs:
4143
with:
4244
name: python_sdk_docs
4345
path: docs/_build/html
44-
- name: Cache virtualenv
46+
- name: Cache venv and .tox
4547
uses: actions/cache/save@v4
4648
if: steps.restore-venv-cache.outputs.cache-hit != 'true'
4749
with:
48-
path: ./venv
50+
path: |
51+
./venv
52+
./.tox
4953
key: ${{ steps.restore-venv-cache.outputs.cache-primary-key }}

.github/workflows/test.yml

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,36 +27,34 @@ jobs:
2727
fail-fast: false
2828

2929
steps:
30-
- name: Checkout source code
30+
- name: Checkout repo
3131
uses: actions/checkout@v4
3232
- name: Set up .env
3333
run: cp ./.env.template ./.env
3434
- name: Run docker-compose with Splunk v${{ matrix.splunk-version }}
3535
run: SPLUNK_VERSION=${{ matrix.splunk-version }} docker compose up -d
36-
- name: Restore cached virtualenv
36+
- name: Restore cached venv and .tox
3737
id: restore-venv-cache
3838
uses: actions/cache/restore@v4
3939
with:
40-
path: ./venv
41-
key: ${{ runner.os }}-${{ matrix.python }}-venv-${{ hashFiles('**/pyproject.toml') }}
42-
- name: Setup Python ${{ matrix.python }}
43-
uses: actions/setup-python@v5
44-
if: steps.restore-venv-cache.outputs.cache-hit != 'true'
45-
with:
46-
python-version: ${{ matrix.python }}
47-
40+
path: |
41+
./venv
42+
./.tox
43+
key: ${{ runner.os }}-3.9-venv-${{ hashFiles('**/pyproject.toml') }}
4844
- name: Build venv
4945
if: steps.restore-venv-cache.outputs.cache-hit != 'true'
5046
run: |
5147
python -m venv ./venv
52-
python -m pip install .
48+
./venv/bin/python -m pip install .
5349
- name: Run test suite
5450
run: ./venv/bin/python -m tox -e py
55-
- name: Cache virtualenv
51+
- name: Cache venv and .tox
5652
uses: actions/cache/save@v4
5753
if: steps.restore-venv-cache.outputs.cache-hit != 'true'
5854
with:
59-
path: ./venv
55+
path: |
56+
./venv
57+
./.tox
6058
key: ${{ steps.restore-venv-cache.outputs.cache-primary-key }}
6159
# [BJ] I'll obviously uncomment this step after I finish fiddling
6260
# fossa-scan:

0 commit comments

Comments
 (0)