Feature/issue 17b pre demo touch up #36
Workflow file for this run
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 | |
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 | |
poetry add flake8 --dev | |
if [ $? -ne 0 ]; then | |
echo "Failed to add flake8. Attempting to update lock file and retry..." | |
poetry lock --no-update | |
poetry add flake8 --dev | |
fi | |
- name: Run pre-commit | |
continue-on-error: true | |
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 |