Add: Functional workflow if you really like it 🤷 #5
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: Tests and static analysis | |
on: | |
push: | |
branches: [ main ] | |
env: | |
PYTHON_VERSION: "3.12" | |
POETRY_VERSION: "1.7.1" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Cache Poetry cache | |
uses: actions/cache@v2 | |
with: | |
path: ~/.cache/pypoetry | |
key: poetry-cache-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ env.POETRY_VERSION }} | |
- name: Cache Packages | |
uses: actions/cache@v2 | |
with: | |
path: ~/.local | |
key: poetry-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ hashFiles('**/poetry.lock') }}-${{ hashFiles('.github/workflows/*.yml') }} | |
- name: Set up Python ${{ env.PYTHON_VERSION }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip poetry==${{ env.POETRY_VERSION }} | |
poetry install | |
- name: Lint | |
run: poetry run ruff check | |
- name: Check formatting | |
run: poetry run ruff format --check | |
- name: Run tests | |
run: poetry run pytest | |
- name: Check types | |
run: poetry run pyright | |
- name: Lint imports | |
run: poetry run lint-imports |