|
7 | 7 | pull_request: |
8 | 8 |
|
9 | 9 | jobs: |
10 | | - lint: |
| 10 | + lint-and-docs: |
11 | 11 | runs-on: ubuntu-latest |
12 | 12 | steps: |
13 | | - - uses: actions/checkout@v3 |
| 13 | + - uses: actions/checkout@v4 |
14 | 14 | - name: Set up Python |
15 | | - uses: actions/setup-python@v4 |
| 15 | + uses: actions/setup-python@v5 |
16 | 16 | with: |
17 | 17 | python-version: 3.9 |
18 | | - - name: Install test runner |
19 | | - run: | |
20 | | - python -m pip install --upgrade pip |
21 | | - python -m pip install tox |
22 | | - - name: Run linters |
23 | | - run: tox -e lint |
24 | | - |
25 | | - docs: |
26 | | - runs-on: ubuntu-latest |
27 | | - steps: |
28 | | - - uses: actions/checkout@v3 |
29 | | - - name: Set up Python |
30 | | - uses: actions/setup-python@v4 |
| 18 | + - name: Install uv |
| 19 | + uses: astral-sh/setup-uv@v5 |
31 | 20 | with: |
32 | 21 | python-version: 3.9 |
33 | | - - name: Install test runner |
34 | | - run: | |
35 | | - python -m pip install --upgrade pip |
36 | | - python -m pip install tox |
| 22 | + - name: Run linters |
| 23 | + run: uvx --with tox-uv tox r -e lint |
37 | 24 | - name: Build docs |
38 | | - run: tox -e docs |
| 25 | + run: uvx --with tox-uv tox r -e docs |
39 | 26 | - name: Update docs |
40 | | - if: | |
41 | | - github.repository == 'avaldebe/PyPMS' && |
42 | | - github.event_name == 'push' && |
43 | | - startsWith(github.ref, 'refs/tags') |
44 | | - run: tox -e docs-deploy -- --force |
| 27 | + if: github.ref_type == 'tag' |
| 28 | + run: uvx --with tox-uv tox r -e docs-deploy -- --force |
45 | 29 |
|
46 | 30 | test: |
47 | 31 | runs-on: ubuntu-latest |
48 | 32 | strategy: |
49 | 33 | matrix: |
50 | | - python-version: ['3.9', '3.10', '3.11', '3.12'] |
| 34 | + python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] |
51 | 35 | steps: |
52 | | - - uses: actions/checkout@v3 |
| 36 | + - uses: actions/checkout@v4 |
53 | 37 | - name: Set up Python ${{ matrix.python-version }} |
54 | | - uses: actions/setup-python@v4 |
| 38 | + uses: actions/setup-python@v5 |
55 | 39 | with: |
56 | 40 | python-version: ${{ matrix.python-version }} |
57 | | - - name: Cache pip |
58 | | - uses: actions/cache@v3 |
| 41 | + - name: Install uv |
| 42 | + uses: astral-sh/setup-uv@v5 |
59 | 43 | with: |
60 | | - path: | |
61 | | - ~/.cache/pip |
62 | | - key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }} |
63 | | - restore-keys: | |
64 | | - ${{ runner.os }}-pip- |
65 | | - - name: Install test runner |
66 | | - run: | |
67 | | - python -m pip install --upgrade pip |
68 | | - python -m pip install tox |
| 44 | + python-version: ${{ matrix.python-version }} |
| 45 | + enable-cache: true |
69 | 46 | - name: Run tests |
70 | | - run: tox -e py |
| 47 | + run: uvx --with tox-uv tox r -e py |
71 | 48 |
|
72 | | - build: |
73 | | - needs: [test, lint] |
| 49 | + build-and-release: |
| 50 | + needs: [test, lint-and-docs] |
74 | 51 | runs-on: ubuntu-latest |
75 | 52 | steps: |
76 | | - - uses: actions/checkout@v3 |
| 53 | + - uses: actions/checkout@v4 |
77 | 54 | - name: Set up Python |
78 | | - uses: actions/setup-python@v4 |
| 55 | + uses: actions/setup-python@v5 |
79 | 56 | with: |
80 | | - python-version: 3.8 |
81 | | - - name: Install PyPA build |
82 | | - run: | |
83 | | - python -m pip install --upgrade pip |
84 | | - python -m pip install build |
85 | | - - name: Build distribution package |
86 | | - run: python -m build |
87 | | - |
88 | | - release: |
89 | | - runs-on: ubuntu-latest |
90 | | - needs: [build, docs, test, lint] |
91 | | - if: | |
92 | | - github.repository == 'avaldebe/PyPMS' && |
93 | | - github.event_name == 'push' && |
94 | | - startsWith(github.ref, 'refs/tags') |
95 | | - steps: |
96 | | - - uses: actions/checkout@v3 |
| 57 | + python-version: 3.13 |
| 58 | + - name: Install uv |
| 59 | + uses: astral-sh/setup-uv@v5 |
| 60 | + with: |
| 61 | + python-version: 3.13 |
| 62 | + - name: Build package |
| 63 | + run: uv build |
97 | 64 | - name: Release |
98 | | - uses: softprops/action-gh-release@v1 |
| 65 | + uses: softprops/action-gh-release@v2 |
| 66 | + if: github.ref_type == 'tag' |
99 | 67 | with: |
100 | 68 | draft: true |
101 | 69 | body_path: README.md |
|
0 commit comments