Update python-app.yml #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
# This workflow will install Python dependencies, run tests and lint with a single version of Python | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | |
name: Python application | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
permissions: | |
contents: read | |
jobs: | |
static-analysis: | |
name: Static Analysis | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.10" | |
- name: Install Poetry Action | |
# You may pin to the exact commit or the version. | |
# uses: snok/install-poetry@93ada01c735cc8a383ce0ce2ae205a21c415379b | |
uses: snok/[email protected] | |
with: | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
installer-parallel: true | |
- name: Install dependencies | |
run: | | |
poetry install --no-interaction --with dev | |
source .venv/bin/activate | |
- name: Lint with flake8 | |
run: | | |
flake8 . | |
- name: Lint with mypy | |
run: | | |
mypy . | |
build-and-test: | |
name: Build and Test | |
needs: static-analysis | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.10" | |
- name: Install Poetry Action | |
# You may pin to the exact commit or the version. | |
# uses: snok/install-poetry@93ada01c735cc8a383ce0ce2ae205a21c415379b | |
uses: snok/[email protected] | |
with: | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
installer-parallel: true | |
- name: Install dependencies | |
run: | | |
poetry install --no-interaction --with dev | |
source .venv/bin/activate | |
- name: Test with pytest | |
run: | | |
pytest |