Skip to content

Commit

Permalink
Fix GitHub Actions workflow for Python tests by specifying PYTHONPATH
Browse files Browse the repository at this point in the history
  • Loading branch information
cdot65 committed Apr 19, 2024
1 parent 08fba4b commit b24e40e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/pytests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,40 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true

- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v2
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}

- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root

- name: Run tests
run: |
source .venv/bin/activate
export PYTHONPATH=$PYTHONPATH:$(pwd)
pytest tests/
- name: Run black
run: |
source .venv/bin/activate
black --check --diff .
- name: Run flake8
run: |
source .venv/bin/activate
Expand Down

0 comments on commit b24e40e

Please sign in to comment.