11# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
22# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
33
4- name : Python package
4+ name : Python checks
55
66on :
77 push :
@@ -16,27 +16,49 @@ jobs:
1616 strategy :
1717 fail-fast : false
1818 matrix :
19- python-version : ["3.8", "3.9", "3.10", "3.11"]
19+ python-version : ["3.7", "3. 8", "3.9", "3.10", "3.11"]
2020
2121 steps :
2222 - uses : actions/checkout@v3
2323 - name : Set up Python ${{ matrix.python-version }}
2424 uses : actions/setup-python@v3
2525 with :
2626 python-version : ${{ matrix.python-version }}
27+ - name : Setup Graphviz
28+ uses : ts-graphviz/setup-graphviz@v1
2729 - name : Install Poetry
2830 uses : snok/install-poetry@v1
2931 with :
3032 virtualenvs-create : true
3133 virtualenvs-in-project : true
3234 installer-parallel : true
35+ - name : Load cached venv
36+ id : cached-poetry-dependencies
37+ uses : actions/cache@v3
38+ with :
39+ path : .venv
40+ key : venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
3341 - name : Install dependencies
42+ if : steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
3443 run : poetry install --no-interaction --no-root
44+ # ----------------------------------------------
45+ # run ruff
46+ # ----------------------------------------------
3547 - name : Linter with ruff
36- run : ruff .
48+ run : |
49+ source .venv/bin/activate
50+ ruff .
51+ # ----------------------------------------------
52+ # run black
53+ # ----------------------------------------------
3754 - name : Linter with black
38- run : black . --check --diff
55+ run : |
56+ source .venv/bin/activate
57+ black . --check --diff
58+ # ----------------------------------------------
59+ # run pytest
60+ # ----------------------------------------------
3961 - name : Test with pytest
4062 run : |
41- poetry shell
63+ source .venv/bin/activate
4264 pytest
0 commit comments