|
1 | | -name: CI |
| 1 | +name: 🧪 CI |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
|
7 | 7 | branches: [ main, master ] |
8 | 8 |
|
9 | 9 | jobs: |
10 | | - test: |
| 10 | + build: |
11 | 11 | runs-on: ubuntu-latest |
| 12 | + |
12 | 13 | strategy: |
13 | 14 | matrix: |
14 | | - python-version: [3.8, 3.10, 3.13] |
| 15 | + python-version: [ "3.11", "3.12" ] |
| 16 | + |
15 | 17 | steps: |
16 | | - - uses: actions/checkout@v4 |
| 18 | + - name: 🧰 Checkout repository |
| 19 | + uses: actions/checkout@v4 |
17 | 20 |
|
18 | | - - name: Set up Python |
19 | | - uses: actions/setup-python@v4 |
| 21 | + - name: 🐍 Set up Python ${{ matrix.python-version }} |
| 22 | + uses: actions/setup-python@v5 |
20 | 23 | with: |
21 | 24 | python-version: ${{ matrix.python-version }} |
| 25 | + cache: "pip" |
22 | 26 |
|
23 | | - - name: Install dependencies |
| 27 | + - name: 📦 Install dependencies |
24 | 28 | run: | |
25 | 29 | python -m pip install --upgrade pip |
26 | | - pip install -r requirements-dev.txt |
| 30 | + pip install -e . |
| 31 | + pip install pytest ruff black |
27 | 32 |
|
28 | | - - name: Run tests |
| 33 | + # ----------------------------- |
| 34 | + # Code quality |
| 35 | + # ----------------------------- |
| 36 | + - name: 🧹 Run Ruff linter (auto-fix mode) |
29 | 37 | run: | |
30 | | - pytest -q |
| 38 | + ruff check . --fix |
| 39 | + continue-on-error: false # set true if you want lint warnings but no CI failure |
31 | 40 |
|
32 | | - lint: |
33 | | - runs-on: ubuntu-latest |
34 | | - steps: |
35 | | - - uses: actions/checkout@v4 |
36 | | - - name: Setup Python |
37 | | - uses: actions/setup-python@v4 |
38 | | - with: |
39 | | - python-version: 3.13 |
40 | | - - name: Install lint |
41 | | - run: pip install ruff |
42 | | - - name: Ruff |
43 | | - run: ruff check . |
44 | | - |
45 | | - package: |
46 | | - if: startsWith(github.ref, 'refs/tags/') |
47 | | - runs-on: ubuntu-latest |
48 | | - steps: |
49 | | - - uses: actions/checkout@v4 |
50 | | - - name: Set up Python |
51 | | - uses: actions/setup-python@v4 |
52 | | - with: |
53 | | - python-version: 3.13 |
54 | | - - name: Build wheel |
| 41 | + - name: 🎨 Check formatting (Black) |
55 | 42 | run: | |
56 | | - python -m pip install --upgrade build |
57 | | - python -m build |
58 | | - - name: Upload artifact |
59 | | - uses: actions/upload-artifact@v4 |
60 | | - with: |
61 | | - name: dist |
62 | | - path: dist/* |
| 43 | + black --check src examples tests |
| 44 | +
|
| 45 | + # ----------------------------- |
| 46 | + # Tests |
| 47 | + # ----------------------------- |
| 48 | + - name: 🧪 Run pytest |
| 49 | + run: | |
| 50 | + pytest -v --maxfail=1 --disable-warnings |
0 commit comments