Create check-source.yml #1
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: Check source code | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.11" | |
- name: Install dependencies | |
run: | | |
curl -sSL https://install.python-poetry.org | python3 - | |
$HOME/.local/bin/poetry install | |
$HOME/.local/bin/poetry shell | |
- name: Lint with flake8 | |
run: | | |
# stop the build if source code does not folows PEP8 | |
flake8 . --count --show-source --statistics | |
- name: Chekc types with mypy | |
run: | | |
mypy . | |
- name: Test with pytest | |
run: | | |
pytest -v |