@@ -80,39 +80,36 @@ jobs:
8080 docker compose -f test-docker-compose.yaml down
8181
8282 lint :
83- runs-on : ubuntu-22.04
83+ runs-on : ubuntu-latest
84+ container :
85+ image : ubuntu:24.04
8486 name : Lint
8587
8688 steps :
89+ - name : Install base tooling
90+ run : |
91+ apt-get update
92+ apt-get install -y --no-install-recommends git python3 python3-venv python3-pip
93+
94+ - name : Create Python virtual environment
95+ run : |
96+ python3 -m venv /opt/venv
97+ /opt/venv/bin/pip install --no-cache-dir --upgrade pip
98+
8799 - name : Check out source code
88- uses : actions/checkout@v3
100+ uses : actions/checkout@v4
89101 with :
90102 fetch-depth : 32 # This is necessary to get the commits
91103
92- - name : Get changed python files between base and head
93- run : >
94- echo "CHANGED_FILES=$(echo $(git diff --name-only ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} -- | grep \.py$))" >> $GITHUB_ENV
104+ - name : Install linting dependencies
105+ run : |
106+ /opt/venv/bin/pip install --no-cache-dir black isort flake8
95107
96- - if : env.CHANGED_FILES
97- name : Set up Python
98- uses : actions/setup-python@master
99- with :
100- python-version : " 3.10"
108+ - name : Run black
109+ run : /opt/venv/bin/black --check --diff api tests
101110
102- - if : env.CHANGED_FILES
103- name : Install Python packages
104- run : |
105- pip install -r docker/api/requirements-tests.txt
111+ - name : Run isort
112+ run : /opt/venv/bin/isort --check --diff api tests
106113
107- - if : env.CHANGED_FILES
108- uses : marian-code/python-lint-annotate@v4
109- with :
110- python-root-list : ${{ env.CHANGED_FILES }}
111- use-black : false
112- use-flake8 : false
113- use-isort : false
114- use-mypy : false
115- use-pycodestyle : true
116- use-pydocstyle : false
117- use-vulture : false
118- python-version : " 3.10"
114+ - name : Run flake8
115+ run : /opt/venv/bin/flake8 --max-line-length=110 --max-complexity=10 api tests
0 commit comments