forked from GraphingLib/GraphingLib
-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (52 loc) · 1.42 KB
/
ci.yml
File metadata and controls
65 lines (52 loc) · 1.42 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: CI - Unit Tests
on:
pull_request:
push:
branches: [main]
jobs:
lint:
name: Lint & Format
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: "0.9.29"
python-version: "3.12"
enable-cache: true
- name: Ruff lint
run: uvx --from ruff==0.15.0 ruff check .
- name: Ruff format check
run: uvx --from ruff==0.15.0 ruff format --check .
tests:
needs: lint
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.12", "3.13", "3.14"]
env:
MPLBACKEND: Agg
MPLCONFIGDIR: ${{ github.workspace }}/.mplconfig
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Install uv and set Python version
uses: astral-sh/setup-uv@v7
with:
version: "0.9.29"
python-version: ${{ matrix.python-version }}
enable-cache: true
- name: Install dependencies
run: |
if [ -f uv.lock ]; then
uv sync --locked --all-extras
else
uv sync
fi
- name: Prepare Matplotlib cache dir
run: mkdir -p "$MPLCONFIGDIR"
- name: Run unit tests
run: uv run python -m unittest discover -s unit_testing -p "*_test.py" -v