-
Notifications
You must be signed in to change notification settings - Fork 55
120 lines (111 loc) · 3 KB
/
ci.yml
File metadata and controls
120 lines (111 loc) · 3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
name: CI
on:
push:
branches: ["master"]
tags:
- "v*"
pull_request:
branches: ["master"]
workflow_dispatch:
jobs:
event_file:
name: "Event File"
runs-on: ubuntu-latest
steps:
- name: Upload
uses: actions/upload-artifact@v7
with:
name: Event File
path: ${{ github.event_path }}
test-linux:
name: "Test Ubuntu"
uses: "./.github/workflows/test-os.yml"
with:
os: '["ubuntu-24.04"]'
python-version: '["3.10", "3.11", "3.12", "3.13", "3.14"]'
test-win:
name: "Test Windows"
uses: "./.github/workflows/test-os.yml"
with:
os: '["windows-2025"]'
python-version: '["3.14"]'
pytest-args: 'tests/test_cli.py tests/test_fromfile.py'
lxml: '["", "lxml"]'
test-mac:
name: "Test macOS"
uses: "./.github/workflows/test-os.yml"
with:
os: '["macos-15"]'
python-version: '["3.14"]'
pytest-args: 'tests/test_cli.py tests/test_fromfile.py'
coverage-lint:
name: "Coverage & Lint"
needs: ["test-linux", "test-win", "test-mac"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v8.1.0
- name: Setup locales
run: |
sudo locale-gen en_US.UTF-8
sudo locale-gen de_DE.UTF-8
sudo update-locale
- name: Install dependencies
run: uv sync --group dev
- name: Lint with ruff
run: uv run ruff check .
- name: Test and coverage
run: |
uv run pytest --cov=src/junitparser --cov-report=xml
bash <(curl -s https://codecov.io/bash)
package-build:
name: "Build Package"
needs: coverage-lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v8.1.0
- name: Build packages
run: |
uv build
ls -lah dist/
- name: Upload
uses: actions/upload-artifact@v7
with:
name: Binaries
path: dist/*
test-whl:
name: "Test whl"
needs: package-build
uses: "./.github/workflows/test-whl.yml"
with:
os: '["ubuntu-24.04"]'
python-version: '["3.10"]'
package-publish:
name: "Publish Package"
needs: test-whl
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v8.1.0
- name: Download Binaries
uses: actions/download-artifact@v8.0.1
with:
name: Binaries
path: dist/
- name: Inspect binaries
run: ls -lah dist/
- name: Verify tag matches package version
run: |
tag="${GITHUB_REF#refs/tags/v}"
version=$(python -c "from pathlib import Path; import tomllib; data = tomllib.loads(Path('pyproject.toml').read_text(encoding='utf-8')); print(data['project']['version'])")
test "$tag" = "$version"
- name: Publish to PyPI
run: uv publish --trusted-publishing always