Update poetry.lock to match pyproject.toml #7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Lint and Test | |
on: | |
push: | |
branches: | |
- main | |
- 'feature/**' | |
- 'bugfix/**' | |
paths-ignore: | |
- '**/*.md' | |
- 'docs/**' | |
pull_request: | |
types: [opened, synchronize, reopened] | |
branches: | |
- main | |
paths-ignore: | |
- '**/*.md' | |
- 'docs/**' | |
workflow_dispatch: | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.12' | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
version: latest | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
- name: Install dependencies | |
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | |
run: poetry install --no-interaction --no-root | |
- name: Run pre-commit | |
run: poetry run pre-commit run --all-files | |
- name: Run flake8 | |
run: poetry run flake8 app tests | |
test: | |
runs-on: ubuntu-latest | |
needs: lint | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.12' | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
version: latest | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
- name: Install dependencies | |
run: | | |
poetry install --no-interaction --no-root | |
if [ $? -ne 0 ]; then | |
echo "Poetry install failed. Attempting to update lock file and retry..." | |
poetry lock --no-update | |
poetry install --no-interaction --no-root | |
fi | |
- name: Run tests | |
run: poetry run pytest tests |