Skip to content

Commit dd702f1

Browse files
add github workflow
1 parent 71a78a0 commit dd702f1

File tree

7 files changed

+1157
-814
lines changed

7 files changed

+1157
-814
lines changed

.github/workflows/main.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- "**"
7+
tags:
8+
- 'v*'
9+
pull_request:
10+
branches:
11+
- "**"
12+
13+
jobs:
14+
test:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
21+
- name: Install uv
22+
uses: astral-sh/setup-uv@v5
23+
with:
24+
# Install a specific version of uv.
25+
version: "0.6.6"
26+
27+
- name: "Set up Python"
28+
uses: actions/setup-python@v5
29+
with:
30+
python-version-file: ".python-version"
31+
32+
- name: Install the project
33+
run: uv sync --all-extras --dev
34+
35+
- name: Run tests with coverage
36+
run: |
37+
uv run pytest | tee pytest-coverage.log
38+
exit_code=${PIPESTATUS[0]}
39+
exit $exit_code
40+
41+
- name: Upload coverage files
42+
uses: actions/upload-artifact@v4
43+
with:
44+
name: coverage-files
45+
path: |
46+
coverage.xml
47+
pytest-coverage.log
48+
htmlcov/
49+
compression-level: 9
50+
51+
lint-and-format:
52+
runs-on: ubuntu-latest
53+
54+
steps:
55+
- name: Checkout code
56+
uses: actions/checkout@v4
57+
with:
58+
fetch-depth: 2
59+
60+
- name: Install uv
61+
uses: astral-sh/setup-uv@v5
62+
with:
63+
# Install a specific version of uv.
64+
version: "0.6.6"
65+
66+
- name: "Set up Python"
67+
uses: actions/setup-python@v5
68+
with:
69+
python-version-file: ".python-version"
70+
71+
- name: Install the project
72+
run: uv sync --all-extras --dev
73+
74+
- name: Run pre-commit hooks
75+
run: |
76+
uv run pre-commit run --all-files || (
77+
git config --global user.name "github-actions[bot]"
78+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
79+
git add -u
80+
git commit -m "Apply Ruff formatting"
81+
git push
82+
)

.github/workflows/release.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- 'v*'
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
if: startsWith(github.ref, 'refs/tags/v')
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Install uv
20+
uses: astral-sh/setup-uv@v5
21+
with:
22+
version: "0.6.6"
23+
24+
- name: "Set up Python"
25+
uses: actions/setup-python@v5
26+
with:
27+
python-version-file: ".python-version"
28+
29+
- name: Install the project
30+
run: uv sync --all-extras --group=build
31+
32+
- name: Build package
33+
run: |
34+
uv run -m build
35+
36+
- name: Upload distributions
37+
uses: actions/upload-artifact@v4
38+
with:
39+
name: release-dists
40+
path: dist/
41+
42+
pypi-publish:
43+
runs-on: ubuntu-latest
44+
needs: build
45+
permissions:
46+
# IMPORTANT: this permission is mandatory for trusted publishing
47+
id-token: write
48+
49+
# Dedicated environments with protections for publishing are strongly recommended.
50+
# For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules
51+
environment:
52+
name: pypi
53+
# OPTIONAL: uncomment and update to include your PyPI project URL in the deployment status:
54+
# url: https://pypi.org/p/YOURPROJECT
55+
#
56+
# ALTERNATIVE: if your GitHub Release name is the PyPI project version string
57+
# ALTERNATIVE: exactly, uncomment the following line instead:
58+
# url: https://pypi.org/project/YOURPROJECT/${{ github.event.release.name }}
59+
60+
steps:
61+
- name: Retrieve release distributions
62+
uses: actions/download-artifact@v4
63+
with:
64+
name: release-dists
65+
path: dist/
66+
67+
- name: Publish release distributions to PyPI
68+
uses: pypa/gh-action-pypi-publish@release/v1
69+
with:
70+
packages-dir: dist/
71+
72+
73+
- name: Create GitHub Release
74+
uses: softprops/action-gh-release@v2
75+
with:
76+
token: ${{ secrets.GITHUB_TOKEN }}
77+
tag_name: ${{ github.ref_name }}
78+
name: Release ${{ github.ref_name }}
79+
body: "Automated release of version ${{ github.ref_name }}."
80+
files: |
81+
dist/*

.pre-commit-config.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
minimum_pre_commit_version: "3.5.0"
2+
3+
repos:
4+
- repo: https://github.com/astral-sh/ruff-pre-commit
5+
# Ruff version.
6+
rev: v0.9.10
7+
hooks:
8+
# Run the linter.
9+
- id: ruff
10+
types_or: [ python, pyi ]
11+
args: [ --fix ]
12+
# Run the formatter.
13+
- id: ruff-format
14+
types_or: [ python, pyi ]

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.11

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Homepage = "https://github.com/ika-rwth-aachen/omega-prime"
4848
Repository = "https://github.com/ika-rwth-aachen/omega-prime"
4949

5050
[project.optional-dependencies]
51-
test = ['ruff', 'pdoc3', 'pytest', 'pytest-sugar', 'pytest-env','pytest-cov','pytest-progress','pytest-codeblocks', 'nbval','ipywidgets']
51+
test = ['ruff', 'pdoc3', 'pre-commit', 'pytest', 'pytest-sugar', 'pytest-env','pytest-cov','pytest-progress','pytest-codeblocks', 'nbval','ipywidgets']
5252

5353
[project.scripts]
5454
omega-prime = "omega_prime.cli:app"
@@ -80,7 +80,7 @@ ignore_packages = [
8080
zero = true
8181

8282
[tool.pytest.ini_options]
83-
addopts = "-ra --junitxml=report.xml --nbval --codeblocks"
83+
addopts = "--nbval --codeblocks --cov=omega_prime --cov-report=xml --cov-report=html --cov-report=term-missing"
8484
testpaths = [
8585
"tests",
8686
"tutorial.ipynb",

requirements.txt

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# uv pip compile pyproject.toml
33
annotated-types==0.7.0
44
# via pydantic
5-
betterosi==0.3.3
5+
betterosi==0.3.4
66
# via omega-prime (pyproject.toml)
77
betterproto2==0.3.1
88
# via betterosi
@@ -35,11 +35,11 @@ kiwisolver==1.4.8
3535
# via matplotlib
3636
loguru==0.7.3
3737
# via lxd-io
38-
lxd-io==0.4.4
38+
lxd-io==0.4.6
3939
# via omega-prime (pyproject.toml)
4040
lxml==5.3.1
4141
# via omega-prime (pyproject.toml)
42-
lz4==4.4.3
42+
lz4==4.4.4
4343
# via mcap
4444
markdown-it-py==3.0.0
4545
# via rich
@@ -82,24 +82,25 @@ packaging==24.2
8282
pandas==2.2.3
8383
# via
8484
# omega-prime (pyproject.toml)
85-
# lxd-io
8685
# pandera
8786
# xarray
8887
pandera==0.23.1
8988
# via omega-prime (pyproject.toml)
9089
pillow==11.1.0
9190
# via matplotlib
92-
protobuf==6.30.1
91+
polars==1.26.0
92+
# via lxd-io
93+
protobuf==6.30.2
9394
# via
9495
# betterosi
9596
# mcap-protobuf-support
96-
pydantic==2.10.6
97+
pydantic==2.11.1
9798
# via pandera
98-
pydantic-core==2.27.2
99+
pydantic-core==2.33.0
99100
# via pydantic
100101
pygments==2.19.1
101102
# via rich
102-
pyparsing==3.2.1
103+
pyparsing==3.2.3
103104
# via matplotlib
104105
pyproj==3.7.1
105106
# via omega-prime (pyproject.toml)
@@ -108,13 +109,13 @@ python-dateutil==2.9.0.post0
108109
# betterproto2
109110
# matplotlib
110111
# pandas
111-
pytz==2025.1
112+
pytz==2025.2
112113
# via pandas
113-
rich==13.9.4
114+
rich==14.0.0
114115
# via typer
115116
scipy==1.15.2
116117
# via omega-prime (pyproject.toml)
117-
shapely==2.0.7
118+
shapely==2.1.0
118119
# via omega-prime (pyproject.toml)
119120
shellingham==1.5.4
120121
# via typer
@@ -130,21 +131,24 @@ typer==0.15.2
130131
# via
131132
# omega-prime (pyproject.toml)
132133
# betterosi
133-
typing-extensions==4.12.2
134+
typing-extensions==4.13.0
134135
# via
135136
# betterproto2
136137
# pydantic
137138
# pydantic-core
138139
# typeguard
139140
# typer
140141
# typing-inspect
142+
# typing-inspection
141143
typing-inspect==0.9.0
142144
# via pandera
143-
tzdata==2025.1
145+
typing-inspection==0.4.0
146+
# via pydantic
147+
tzdata==2025.2
144148
# via pandas
145149
win32-setctime==1.2.0
146150
# via loguru
147-
xarray==2025.1.2
151+
xarray==2025.3.1
148152
# via omega-prime (pyproject.toml)
149153
zstandard==0.23.0
150154
# via mcap

0 commit comments

Comments
 (0)