Skip to content

Commit d2eff28

Browse files
committed
workflows: Update to unified rules
Signed-off-by: Denys Fedoryshchenko <denys.f@collabora.com>
1 parent 03aba54 commit d2eff28

1 file changed

Lines changed: 24 additions & 28 deletions

File tree

.github/workflows/main.yml

Lines changed: 24 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@ on:
1515
workflow_dispatch:
1616

1717
jobs:
18-
check:
18+
tests:
1919
runs-on: ubuntu-22.04
20+
name: tests
2021

2122
strategy:
2223
matrix:
23-
python-version: ['3.10', '3.11']
24+
python-version: ['3.11']
2425

2526
steps:
2627

@@ -80,39 +81,34 @@ jobs:
8081
docker compose -f test-docker-compose.yaml down
8182
8283
lint:
83-
runs-on: ubuntu-22.04
84+
runs-on: ubuntu-latest
85+
container:
86+
image: ubuntu:24.04
8487
name: Lint
8588

8689
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+
87100
- name: Check out source code
88-
uses: actions/checkout@v3
101+
uses: actions/checkout@v4
89102
with:
90103
fetch-depth: 32 # This is necessary to get the commits
91104

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
95108
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
101111

102-
- if: env.CHANGED_FILES
103-
name: Install Python packages
112+
- name: Run ruff lint check (E/W/F/I + complexity policy)
104113
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

Comments
 (0)