Skip to content

Commit 12dc1d0

Browse files
committed
new workflows
1 parent bd63f48 commit 12dc1d0

8 files changed

+145
-114
lines changed

.editorconfig

-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ end_of_line = lf
1414
indent_size = 4
1515
max_line_length = 120
1616

17-
[*.yml]
18-
indent_size = 4
1917

2018
[*.md]
2119
indent_size = 4
+25-19
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,28 @@
11
name: Publish Develop Docs
22
on:
3-
push:
4-
branches:
5-
- main
3+
push:
4+
branches:
5+
- main
66
jobs:
7-
deploy:
8-
runs-on: ubuntu-latest
9-
steps:
10-
- uses: actions/checkout@v4
11-
with:
12-
fetch-depth: 0
13-
- uses: actions/setup-python@v5
14-
with:
15-
python-version: 3.x
16-
- run: pip install -r requirements/build-docs.txt
17-
- name: Publish Develop Docs
18-
run: |
19-
git config user.name github-actions
20-
git config user.email [email protected]
21-
cd docs
22-
mike deploy --push develop
7+
deploy:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
with:
12+
fetch-depth: 0
13+
- uses: actions/setup-python@v5
14+
with:
15+
python-version: 3.x
16+
- run: pip install -r requirements/build-docs.txt
17+
- name: Install dependecies
18+
run: |
19+
pip install --upgrade hatch uv
20+
- name: Configure Git
21+
run: |
22+
git config user.name github-actions
23+
git config user.email [email protected]
24+
- name: Publish Develop Docs
25+
run: |
26+
hatch run docs:deploy_develop
27+
concurrency:
28+
group: publish-docs
+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Publish Latest Docs
2+
on:
3+
release:
4+
types: [published]
5+
6+
jobs:
7+
deploy:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
with:
12+
fetch-depth: 0
13+
- uses: actions/setup-python@v5
14+
with:
15+
python-version: 3.x
16+
- run: pip install -r requirements/build-docs.txt
17+
- name: Install dependecies
18+
run: |
19+
pip install --upgrade hatch uv
20+
- name: Configure Git
21+
run: |
22+
git config user.name github-actions
23+
git config user.email [email protected]
24+
- name: Publish Develop Docs
25+
run: |
26+
hatch run docs:deploy_latest ${{ github.ref_name }}
27+
concurrency:
28+
group: publish-docs

.github/workflows/publish-py.yaml

+23-21
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,28 @@
44
name: Publish Python
55

66
on:
7-
release:
8-
types: [published]
7+
release:
8+
types: [published]
99

1010
jobs:
11-
publish-package:
12-
runs-on: ubuntu-latest
13-
steps:
14-
- uses: actions/checkout@v4
15-
- name: Set up Python
16-
uses: actions/setup-python@v5
17-
with:
18-
python-version: "3.x"
19-
- name: Install dependencies
20-
run: |
21-
python -m pip install --upgrade pip
22-
pip install -r requirements/build-pkg.txt
23-
- name: Build and publish
24-
env:
25-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
26-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
27-
run: |
28-
python setup.py bdist_wheel
29-
twine upload dist/*
11+
publish-package:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
- name: Set up Python
16+
uses: actions/setup-python@v5
17+
with:
18+
python-version: "3.x"
19+
- name: Install dependencies
20+
run: |
21+
pip3 --quiet install --upgrade hatch uv twine
22+
pip install -r requirements/build-pkg.txt
23+
- name: Build Package
24+
run: |
25+
hatch build
26+
- name: Publish to PyPI
27+
env:
28+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
29+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
30+
run: |
31+
twine upload dist/*

.github/workflows/publish-release-docs.yml

-23
This file was deleted.

.github/workflows/test-docs.yml

+3-9
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,11 @@ jobs:
2222
python-version: 3.x
2323
- name: Install Python Dependencies
2424
run: |
25-
pip install -r requirements/build-docs.txt
26-
pip install -r requirements/check-types.txt
27-
pip install -r requirements/check-style.txt
25+
pip3 --quiet install --upgrade hatch uv ruff
2826
- name: Check docs build
2927
run: |
30-
linkcheckMarkdown docs/ -v -r
31-
linkcheckMarkdown README.md -v -r
32-
linkcheckMarkdown CHANGELOG.md -v -r
33-
cd docs
34-
mkdocs build --strict
28+
hatch run docs:build
29+
hatch run docs:linkcheck
3530
- name: Check docs examples
3631
run: |
37-
mypy --show-error-codes docs/examples/python/
3832
ruff check docs/examples/python/

.github/workflows/test-src.yaml

-40
This file was deleted.

.github/workflows/test-src.yml

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
schedule:
11+
- cron: "0 0 * * *"
12+
13+
jobs:
14+
test-python:
15+
name: Python ${{ matrix.python-version }}
16+
runs-on: ubuntu-latest
17+
strategy:
18+
matrix:
19+
python-version: ["3.9", "3.10", "3.11", "3.12"]
20+
steps:
21+
- uses: actions/checkout@v4
22+
- name: Use Python ${{ matrix.python-version }}
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
- name: Install Python Dependencies
27+
run: |
28+
pip3 install hatch uv
29+
- name: Run Tests
30+
run: |
31+
hatch test --cover --python ${{ matrix.python-version }}
32+
mv .coverage ".coverage.py${{ matrix.python-version }}"
33+
- name: Upload coverage data
34+
uses: actions/upload-artifact@v4
35+
with:
36+
name: "coverage-data-py${{ matrix.python-version }}"
37+
path: ".coverage.py${{ matrix.python-version }}"
38+
if-no-files-found: error
39+
include-hidden-files: true
40+
retention-days: 7
41+
coverage-python:
42+
needs:
43+
- test-python
44+
runs-on: ubuntu-latest
45+
steps:
46+
- uses: actions/checkout@v4
47+
- name: Use Latest Python
48+
uses: actions/setup-python@v5
49+
with:
50+
python-version: "3.x"
51+
- name: Install Python Dependencies
52+
run: python -m pip install --upgrade coverage[toml]
53+
- name: Download data
54+
uses: actions/download-artifact@v4
55+
with:
56+
merge-multiple: true
57+
- name: Combine coverage and fail if it's <100%
58+
run: |
59+
python -m coverage combine
60+
python -m coverage html --skip-covered --skip-empty
61+
python -m coverage report --fail-under=100
62+
- name: Upload HTML report
63+
uses: actions/upload-artifact@v4
64+
with:
65+
name: coverage-report
66+
path: htmlcov

0 commit comments

Comments
 (0)