Skip to content

Commit 292f717

Browse files
Add github workflows
1 parent 9be4873 commit 292f717

File tree

4 files changed

+107
-1
lines changed

4 files changed

+107
-1
lines changed

.github/workflows/publish.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Publish 📦 to PyPI
2+
on:
3+
push:
4+
tags:
5+
- v[0-9]+.[0-9]+.[0-9]+
6+
7+
jobs:
8+
build-n-publish:
9+
name: Build and publish Python distributions to PyPI
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout repo
14+
uses: actions/checkout@v4
15+
16+
- name: Set up Python 3.x
17+
uses: actions/setup-python@v2
18+
with:
19+
python-version: 3.x
20+
21+
- name: Install uv
22+
uses: astral-sh/setup-uv@v3
23+
24+
- name: Build wheel file in `dist/`
25+
run: uv build
26+
27+
- name: Build docs
28+
run: |
29+
mkdir gh-pages
30+
touch gh-pages/.nojekyll
31+
cd docs/
32+
uv run sphinx-build -b html . _build
33+
cp -r _build/* ../gh-pages/
34+
35+
- name: Deploy documentation
36+
if: ${{ github.event_name == 'push' }}
37+
uses: JamesIves/github-pages-deploy-action@4.1.4
38+
with:
39+
branch: gh-pages
40+
folder: gh-pages
41+
42+
- name: Publish distribution 📦 to Test PyPI with UV
43+
run: uv publish --token ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/publishTest.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Publish 📦 to TestPyPI
2+
on:
3+
push:
4+
tags:
5+
- v[0-9]+.[0-9]+.[0-9]+-alpha[0-9]*
6+
- v[0-9]+.[0-9]+.[0-9]+-beta[0-9]*
7+
- v[0-9]+.[0-9]+.[0-9]+-rc[0-9]*
8+
9+
jobs:
10+
build-n-publish:
11+
name: Build and publish Python distributions to TestPyPI
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout repo
16+
uses: actions/checkout@v4
17+
18+
- name: Set up Python 3.x
19+
uses: actions/setup-python@v2
20+
with:
21+
python-version: 3.x
22+
23+
- name: Install uv
24+
uses: astral-sh/setup-uv@v3
25+
26+
- name: Build wheel file in `dist/`
27+
run: uv build
28+
29+
- name: Build docs
30+
run: |
31+
mkdir gh-pages
32+
touch gh-pages/.nojekyll
33+
cd docs/
34+
uv run sphinx-build -b html . _build
35+
36+
- name: Publish distribution 📦 to Test PyPI with UV
37+
run: uv publish --token ${{ secrets.TEST_PYPI_API_TOKEN }} --publish-url https://test.pypi.org/legacy/

.github/workflows/unittest.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Unit Tests
2+
on: push
3+
jobs:
4+
build:
5+
runs-on: ubuntu-latest
6+
strategy:
7+
matrix:
8+
python-version: ['3.11', '3.12', '3.12']
9+
10+
timeout-minutes: 10
11+
12+
steps:
13+
- name: Check out repo
14+
uses: actions/checkout@v4
15+
16+
- name: Setup Python
17+
uses: actions/setup-python@v2
18+
with:
19+
python-version: ${{ matrix.python-version }}
20+
21+
- name: Install uv
22+
uses: astral-sh/setup-uv@v3
23+
24+
- name: Execute Tests
25+
run: uv run pytest -v test/ --cov=mats

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ dependencies = [
2121

2222
[dependency-groups]
2323
dev = [
24-
"flake8>=7.1.1",
24+
"coverage>=7.6.10",
2525
"pytest>=8.3.4",
26+
"pytest-cov>=6.0.0",
2627
"ruff>=0.9.2",
2728
"sphinx>=8.1.3",
2829
]

0 commit comments

Comments
 (0)