Skip to content

Commit

Permalink
chore(build): bump python setup to v5 to use caching feature
Browse files Browse the repository at this point in the history
Remove venv-cache
  • Loading branch information
DarwinsBuddy committed Mar 17, 2024
1 parent 7bbd995 commit a455fb8
Showing 1 changed file with 3 additions and 18 deletions.
21 changes: 3 additions & 18 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,35 +12,20 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Restore venv cache
uses: actions/cache@v3
id: cache-venv # name for referring later
with:
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
cache: 'pip'
- name: Install dependencies (if changed)
run: |
python -m venv .venv
. .venv/bin/activate
pip install -r tests/requirements.txt
if: steps.cache-venv.outputs.cache-hit != 'true'
run: pip install -r tests/requirements.txt
- name: Lint with flake8
run: |
. ./.venv/bin/activate
# stop the build if there are Python syntax errors or undefined names
flake8 custom_components/wnsm --count --select=E9,F63,F7,F82 --show-source --statistics --config tests/setup.cfg
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 custom_components/wnsm --count --exit-zero --max-complexity=10 --statistics --config tests/setup.cfg
- name: Test with pytest
run: |
. .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
Expand Down

0 comments on commit a455fb8

Please sign in to comment.