-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (33 loc) · 1004 Bytes
/
Copy pathci.yml
File metadata and controls
36 lines (33 loc) · 1004 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: CI
on:
push:
branches: [main]
pull_request:
env:
MPLBACKEND: Agg
jobs:
test:
name: Test (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
- name: Install Python
run: uv python install ${{ matrix.python-version }}
- name: Install dependencies
run: uv sync --group dev 2>/dev/null || uv pip install -e ".[dev]"
- name: Ruff check
run: uv run ruff check alf/
- name: Ruff format check
run: uv run ruff format --check alf/
- name: No-mock check
run: |
if grep -rn "unittest\.mock\|MagicMock\|from mock import\|@patch" alf/tests/ --include="*.py" | grep -v "^#"; then
echo "::error::unittest.mock usage detected in tests"
exit 1
fi
- name: Pytest
run: uv run pytest alf/tests/ -v --tb=short