|
10 | 10 | branches: [ "main" ] |
11 | 11 |
|
12 | 12 | jobs: |
13 | | - build: |
| 13 | + build-native: |
14 | 14 |
|
15 | 15 | runs-on: ubuntu-latest |
16 | 16 | strategy: |
17 | 17 | fail-fast: false |
18 | 18 | matrix: |
19 | | - python-version: ["3.8", "3.9", "3.10", "3.11"] |
| 19 | + python-version: ["3.10", "3.11", "3.12", "3.13"] |
20 | 20 |
|
21 | 21 | steps: |
22 | | - - uses: actions/checkout@v3 |
| 22 | + - uses: actions/checkout@v6 |
23 | 23 |
|
24 | 24 | - name: Set up Python ${{ matrix.python-version }} |
25 | | - uses: actions/setup-python@v3 |
| 25 | + uses: actions/setup-python@v6 |
26 | 26 | with: |
27 | 27 | python-version: ${{ matrix.python-version }} |
28 | 28 |
|
29 | 29 | - name: Install dependencies |
30 | 30 | run: | |
31 | | - python -m pip install --upgrade pip setuptools wheel |
32 | | - python -m pip install -e .[test,style,build] |
33 | | -
|
34 | | - - name: Lint with black |
35 | | - run: black --check . |
36 | | - |
37 | | - - name: Lint with flake8 |
38 | | - run: flake8 . --show-source --statistics |
39 | | - |
40 | | - - name: Lint with isort |
41 | | - run: isort --check --diff . |
42 | | - |
43 | | - - name: Check with mypy |
44 | | - run: mypy src |
| 31 | + python3 -m pip install --upgrade pip setuptools wheel |
| 32 | + python3 -m pip install -e .[test,style,build] |
| 33 | + python3 -m pip install build |
45 | 34 |
|
46 | 35 | - name: Test with pytest |
47 | 36 | run: pytest |
48 | 37 |
|
49 | | - - name: Build |
50 | | - run: python3 -m build |
51 | | - |
52 | | - - name: Test with twine |
53 | | - run: twine check --strict dist/* |
| 38 | + - name: Build and test with twine |
| 39 | + run: | |
| 40 | + python3 -m build |
| 41 | + twine check --strict dist/* |
54 | 42 |
|
55 | 43 | - name: Upload built package |
56 | | - uses: actions/upload-artifact@v3 |
57 | | - if: ${{ matrix.python-version == '3.8' }} |
| 44 | + uses: actions/upload-artifact@v6 |
| 45 | + if: ${{ matrix.python-version == '3.10' }} |
58 | 46 | with: |
59 | 47 | name: Package |
60 | 48 | path: dist |
61 | 49 |
|
62 | 50 | - name: Collect coverage |
63 | | - if: ${{ matrix.python-version == '3.8' }} |
| 51 | + if: ${{ matrix.python-version == '3.10' }} |
64 | 52 | run: |
65 | 53 | coverage html |
66 | 54 |
|
67 | 55 | - name: Upload coverage report |
68 | | - uses: actions/upload-artifact@v3 |
69 | | - if: ${{ matrix.python-version == '3.8' }} |
| 56 | + uses: actions/upload-artifact@v6 |
| 57 | + if: ${{ matrix.python-version == '3.10' }} |
70 | 58 | with: |
71 | 59 | name: Coverage |
72 | 60 | path: htmlcov |
73 | 61 |
|
| 62 | + build-uv: |
| 63 | + |
| 64 | + runs-on: ubuntu-latest |
| 65 | + |
| 66 | + steps: |
| 67 | + - uses: actions/checkout@v6 |
| 68 | + |
| 69 | + - name: "Set up Python" |
| 70 | + uses: actions/setup-python@v6 |
| 71 | + with: |
| 72 | + python-version-file: ".python-version" |
| 73 | + |
| 74 | + - name: Install uv |
| 75 | + uses: astral-sh/setup-uv@v7 |
| 76 | + |
| 77 | + - name: Install the project |
| 78 | + run: uv sync --locked --all-extras --dev |
| 79 | + |
| 80 | + - name: Lint with black |
| 81 | + run: uv run black --check . |
| 82 | + |
| 83 | + - name: Lint with flake8 |
| 84 | + run: uv run flake8 . --show-source --statistics |
| 85 | + |
| 86 | + - name: Lint with isort |
| 87 | + run: uv run isort --check --diff . |
| 88 | + |
| 89 | + - name: Check with mypy |
| 90 | + run: uv run mypy src |
| 91 | + |
| 92 | + - name: Test with pytest |
| 93 | + run: uv run pytest |
| 94 | + |
| 95 | + - name: Build and test with twine |
| 96 | + run: | |
| 97 | + uv build |
| 98 | + twine check --strict dist/* |
74 | 99 |
|
75 | 100 | docs: |
76 | 101 |
|
77 | | - needs: build |
| 102 | + needs: build-native |
78 | 103 | runs-on: ubuntu-latest |
79 | 104 |
|
80 | 105 | steps: |
81 | | - - uses: actions/checkout@v3 |
| 106 | + - uses: actions/checkout@v6 |
82 | 107 |
|
83 | | - - name: Set up Python 3.8 |
84 | | - uses: actions/setup-python@v3 |
| 108 | + - name: Set up Python 3.10 |
| 109 | + uses: actions/setup-python@v6 |
85 | 110 | with: |
86 | | - python-version: '3.8' |
| 111 | + python-version: '3.10' |
87 | 112 |
|
88 | 113 | - name: Install dependencies |
89 | 114 | run: | |
90 | 115 | python -m pip install --upgrade pip setuptools wheel |
91 | | - python -m pip install -e .[docs] |
| 116 | + python -m pip install -r docs/requirements.txt |
92 | 117 |
|
93 | 118 | - name: Build documentation |
94 | 119 | run: | |
95 | 120 | sphinx-build -b html docs dist/docs |
96 | 121 | sphinx-build -b linkcheck docs dist/docs |
97 | 122 |
|
98 | 123 | - name: Upload documentation |
99 | | - uses: actions/upload-artifact@v3 |
| 124 | + uses: actions/upload-artifact@v6 |
100 | 125 | with: |
101 | 126 | name: Docs |
102 | 127 | path: dist/docs |
0 commit comments