Skip to content

Commit

Permalink
Fix venv caching
Browse files Browse the repository at this point in the history
  • Loading branch information
DarwinsBuddy committed Apr 23, 2023
1 parent 71cdf72 commit 5acab6b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ jobs:
uses: actions/cache@v3
id: cache-venv # name for referring later
with:
path: ./.venv/ # what we cache: the virtualenv
path: .venv/ # what we cache: the virtualenv
# The cache key depends on requirements.txt
key: ${{ runner.os }}-${{ matrix.python-version }}-venv-${{ hashFiles('tests/requirements*.txt') }}
restore-keys: |
${{ runner.os }}-${{ matrix.python-version }}-venv-
# Build a virtualenv, but only if it doesn't already exist
- name: Install dependencies (if changed)
run: |
python -m venv ./.venv
. ./.venv/bin/activate
python -m venv .venv
. .venv/bin/activate
pip install -r tests/requirements.txt
if: steps.cache-venv.outputs.cache-hit != 'true'
- name: Lint with flake8
Expand All @@ -40,10 +40,10 @@ jobs:
flake8 custom_components/wnsm --count --exit-zero --max-complexity=10 --statistics --config tests/setup.cfg
- name: Test with pytest
run: |
. ./.venv/bin/activate
. .venv/bin/activate
pytest --cov=wnsm tests --cov-report html --cov-report xml --cov-report term
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: false
files: coverage.xml
files: coverage.xml

0 comments on commit 5acab6b

Please sign in to comment.