|
15 | 15 | workflow_dispatch: |
16 | 16 |
|
17 | 17 | jobs: |
18 | | - check: |
| 18 | + tests: |
19 | 19 | runs-on: ubuntu-22.04 |
| 20 | + name: tests |
20 | 21 |
|
21 | 22 | strategy: |
22 | 23 | matrix: |
23 | | - python-version: ['3.10', '3.11'] |
| 24 | + python-version: ['3.11'] |
24 | 25 |
|
25 | 26 | steps: |
26 | 27 |
|
@@ -80,39 +81,34 @@ jobs: |
80 | 81 | docker compose -f test-docker-compose.yaml down |
81 | 82 |
|
82 | 83 | lint: |
83 | | - runs-on: ubuntu-22.04 |
| 84 | + runs-on: ubuntu-latest |
| 85 | + container: |
| 86 | + image: ubuntu:24.04 |
84 | 87 | name: Lint |
85 | 88 |
|
86 | 89 | steps: |
| 90 | + - name: Install base tooling |
| 91 | + run: | |
| 92 | + apt-get update |
| 93 | + apt-get install -y --no-install-recommends git python3 python3-venv python3-pip |
| 94 | +
|
| 95 | + - name: Create Python virtual environment |
| 96 | + run: | |
| 97 | + python3 -m venv /opt/venv |
| 98 | + /opt/venv/bin/pip install --no-cache-dir --upgrade pip |
| 99 | +
|
87 | 100 | - name: Check out source code |
88 | | - uses: actions/checkout@v3 |
| 101 | + uses: actions/checkout@v4 |
89 | 102 | with: |
90 | 103 | fetch-depth: 32 # This is necessary to get the commits |
91 | 104 |
|
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 |
| 105 | + - name: Install linting dependencies |
| 106 | + run: | |
| 107 | + /opt/venv/bin/pip install --no-cache-dir ruff |
95 | 108 |
|
96 | | - - if: env.CHANGED_FILES |
97 | | - name: Set up Python |
98 | | - uses: actions/setup-python@master |
99 | | - with: |
100 | | - python-version: "3.10" |
| 109 | + - name: Run ruff format check (line-length policy) |
| 110 | + run: /opt/venv/bin/ruff format --check --diff --line-length 110 api tests |
101 | 111 |
|
102 | | - - if: env.CHANGED_FILES |
103 | | - name: Install Python packages |
| 112 | + - name: Run ruff lint check (E/W/F/I + complexity policy) |
104 | 113 | run: | |
105 | | - pip install -r docker/api/requirements-tests.txt |
106 | | -
|
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 | + /opt/venv/bin/ruff check --line-length 110 --select E,W,F,I,C90 --ignore E203,W503 api tests |
0 commit comments