Skip to content

Commit f9dc4c4

Browse files
committed
Update CI script
1 parent 4520743 commit f9dc4c4

1 file changed

Lines changed: 60 additions & 35 deletions

File tree

.github/workflows/python-package.yml

Lines changed: 60 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -10,93 +10,118 @@ on:
1010
branches: [ "main" ]
1111

1212
jobs:
13-
build:
13+
build-native:
1414

1515
runs-on: ubuntu-latest
1616
strategy:
1717
fail-fast: false
1818
matrix:
19-
python-version: ["3.8", "3.9", "3.10", "3.11"]
19+
python-version: ["3.10", "3.11", "3.12", "3.13"]
2020

2121
steps:
22-
- uses: actions/checkout@v3
22+
- uses: actions/checkout@v6
2323

2424
- name: Set up Python ${{ matrix.python-version }}
25-
uses: actions/setup-python@v3
25+
uses: actions/setup-python@v6
2626
with:
2727
python-version: ${{ matrix.python-version }}
2828

2929
- name: Install dependencies
3030
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
4534
4635
- name: Test with pytest
4736
run: pytest
4837

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/*
5442
5543
- 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' }}
5846
with:
5947
name: Package
6048
path: dist
6149

6250
- name: Collect coverage
63-
if: ${{ matrix.python-version == '3.8' }}
51+
if: ${{ matrix.python-version == '3.10' }}
6452
run:
6553
coverage html
6654

6755
- 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' }}
7058
with:
7159
name: Coverage
7260
path: htmlcov
7361

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/*
7499
75100
docs:
76101

77-
needs: build
102+
needs: build-native
78103
runs-on: ubuntu-latest
79104

80105
steps:
81-
- uses: actions/checkout@v3
106+
- uses: actions/checkout@v6
82107

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
85110
with:
86-
python-version: '3.8'
111+
python-version: '3.10'
87112

88113
- name: Install dependencies
89114
run: |
90115
python -m pip install --upgrade pip setuptools wheel
91-
python -m pip install -e .[docs]
116+
python -m pip install -r docs/requirements.txt
92117
93118
- name: Build documentation
94119
run: |
95120
sphinx-build -b html docs dist/docs
96121
sphinx-build -b linkcheck docs dist/docs
97122
98123
- name: Upload documentation
99-
uses: actions/upload-artifact@v3
124+
uses: actions/upload-artifact@v6
100125
with:
101126
name: Docs
102127
path: dist/docs

0 commit comments

Comments
 (0)