Skip to content

Commit

Permalink
Update workflows to use poetry to install deps
Browse files Browse the repository at this point in the history
* Workflows upgraded to setup-python v4.
* Workflows now install deps using poetry.
* Lint and test run through poetry interface.
* Deps cached for faster testing in later runs.
  • Loading branch information
chrisbrickhouse committed Mar 29, 2024
1 parent db1dc52 commit 1c608cc
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/test-and-run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,24 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Install poetry
uses: pipx install poetry
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: poetry
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
poetry env use "${{ matrix.python-version }}"
poetry install
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
poetry run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
poetry run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
python -m pytest tests/
poetry run pytest tests/

0 comments on commit 1c608cc

Please sign in to comment.