Skip to content

Commit 69968ff

Browse files
committed
[CI/CD] testing github workflow
Also outputs testing coverage using EnricoMi/publish-unit-test-result-action
1 parent 11eb9c0 commit 69968ff

File tree

6 files changed

+123
-19
lines changed

6 files changed

+123
-19
lines changed

.coverage

52 KB
Binary file not shown.

.github/workflows/tests.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Pytest
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
permissions:
10+
checks: write
11+
pull-requests: write
12+
13+
jobs:
14+
test:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Install uv
21+
uses: astral-sh/setup-uv@v5
22+
with:
23+
enable-cache: true
24+
25+
- name: Setup Python
26+
uses: actions/setup-python@v5
27+
with:
28+
python-version-file: "pyproject.toml"
29+
30+
- name: Install the project
31+
run: uv sync --all-extras --dev
32+
33+
- name: Run tests
34+
run: uv run python -Im pytest -v --cov=anonymization_manager --cov-report=xml --junitxml=test-results.xml
35+
36+
- name: Publish Test Results
37+
uses: EnricoMi/publish-unit-test-result-action@v2
38+
if: always()
39+
with:
40+
files: test-results.xml

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
**/.venv/**/**
22
.ruff_cache/**
33
**/__pycache__/**
4+
.mypy_cache/**
5+
.pytest_cache/**
46
arx_builder/build
57
bin
68
.vscode
7-
*.org
9+
*.org
10+
test-results.xml
11+
coverage.xml

.pre-commit-config.yaml

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,12 @@ repos:
88
args: [ --fix ]
99
# Run the formatter.
1010
- id: ruff-format
11-
- repo: local
12-
hooks:
13-
- id: mypy
14-
name: mypy
15-
entry: uv run mypy src/
16-
language: system
17-
types: [python]
18-
pass_filenames: false
19-
fail_fast: true
20-
- repo: local
21-
hooks:
22-
- id: pytest
23-
name: pytest
24-
entry: uv run pytest
25-
language: system
26-
types: [python]
27-
pass_filenames: false
28-
fail_fast: true
11+
# - repo: local
12+
# hooks:
13+
# - id: mypy
14+
# name: mypy
15+
# entry: uv run mypy src/
16+
# language: system
17+
# types: [python]
18+
# pass_filenames: false
19+
# fail_fast: true

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ dev = [
2525
"basedpyright>=1.31.4",
2626
"mypy>=1.18.2",
2727
"pre-commit>=4.4.0",
28+
"pytest-cov>=7.0.0",
2829
"ruff>=0.13.1",
2930
]
3031
docs = [

uv.lock

Lines changed: 68 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)