@@ -19,47 +19,35 @@ jobs:
19
19
- name : Check out repository
20
20
uses : actions/checkout@v4
21
21
22
+ # 1. Настройка Python
23
+ - name : Set up Python ${{ matrix.python-version }}
24
+ uses : actions/setup-python@v5
25
+ with :
26
+ python-version : ${{ matrix.python-version }}
27
+
28
+ # 2. Установка uv
22
29
- name : Install uv
23
- run : curl -LsSf https://astral.sh/uv/install.sh | sh
24
- if : runner.os != 'Windows'
25
- - name : Install uv (Windows)
26
- run : powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
27
- if : runner.os == 'Windows'
28
- - name : Add uv to PATH
29
- run : echo "$HOME/.cargo/bin" >> $GITHUB_PATH
30
- if : runner.os != 'Windows'
31
- - name : Add uv to PATH (Windows)
32
- run : echo "$((Get-Item (Get-Command uv).Source).Directory.FullName)" | Out-File -FilePath $env:GITHUB_PATH -Append
33
- if : runner.os == 'Windows'
30
+ run : pip install uv
34
31
35
- - name : Set up Python and install dependencies
32
+ # 3. Создание venv и установка зависимостей
33
+ - name : Create venv and install dependencies
36
34
run : |
37
- uv venv -p ${{ matrix.python-version }}
35
+ uv venv
38
36
uv pip install -e ".[dev]"
39
37
40
- - name : Run Linting and Tests (Linux/macOS)
41
- if : runner.os != 'Windows'
42
- run : |
43
- echo "--- Running Lint and Format Check ---"
44
- .venv/bin/ruff check src/ tests/
45
- .venv/bin/ruff format --check src/ tests/
46
-
47
- echo "--- Running Tests with Coverage ---"
48
- .venv/bin/coverage run -m unittest discover tests
49
-
50
- - name : Run Linting and Tests (Windows)
51
- if : runner.os == 'Windows'
52
- shell : pwsh
38
+ # 4. Запуск проверок (единый шаг для всех ОС)
39
+ - name : Run Linting and Tests
53
40
run : |
54
41
echo "--- Running Lint and Format Check ---"
55
- .\.venv\Scripts\ ruff.exe check src/ tests/
56
- .\.venv\Scripts\ ruff.exe format --check src/ tests/
42
+ uv run ruff check src/ tests/
43
+ uv run ruff format --check src/ tests/
57
44
58
45
echo "--- Running Tests with Coverage ---"
59
- .\.venv\Scripts\ coverage.exe run -m unittest discover tests
46
+ uv run coverage run -m unittest discover tests
60
47
48
+ # 5. Загрузка отчета
61
49
- name : Upload coverage reports to Codecov
62
- uses : codecov/codecov-action@v5
50
+ uses : codecov/codecov-action@v4
63
51
with :
64
52
token : ${{ secrets.CODECOV_TOKEN }}
65
53
fail_ci_if_error : true
0 commit comments