Skip to content

Commit eee12c6

Browse files
committed
Test
1 parent 2a04a68 commit eee12c6

File tree

3 files changed

+35
-14
lines changed

3 files changed

+35
-14
lines changed

.github/workflows/build.yml

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,22 @@ name: Build
22
on: [push, pull_request]
33

44
jobs:
5+
pre-commit:
6+
name: Run pre-commit hooks
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v3
10+
- uses: astral-sh/setup-uv@v5
11+
- uses: actions/setup-python@v5
12+
with:
13+
python-version-file: pyproject.toml
14+
15+
- name: Install the project
16+
run: uv sync --locked --dev
17+
18+
- name: Run pre-commit hooks
19+
uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd
20+
521
build-wheels:
622
name: Build wheels for ${{ matrix.os }}
723
runs-on: ${{ matrix.runs-on }}
@@ -10,14 +26,14 @@ jobs:
1026
include:
1127
- os: linux-intel
1228
runs-on: ubuntu-latest
13-
- os: linux-arm
14-
runs-on: ubuntu-24.04-arm
15-
- os: windows-intel
16-
runs-on: windows-latest
17-
- os: macos-intel
18-
runs-on: macos-13
19-
- os: macos-arm
20-
runs-on: macos-latest
29+
# - os: linux-arm
30+
# runs-on: ubuntu-24.04-arm
31+
# - os: windows-intel
32+
# runs-on: windows-latest
33+
# - os: macos-intel
34+
# runs-on: macos-13
35+
# - os: macos-arm
36+
# runs-on: macos-latest
2137

2238
steps:
2339
- uses: actions/checkout@v4
@@ -36,16 +52,15 @@ jobs:
3652
if: matrix.os == 'linux-intel'
3753
id: get-coverage-files
3854
run: |
39-
FILES=$(find ./wheelhouse -type f -name 'coverage*' -printf '%p ')
55+
FILES=$(find ./wheelhouse -type f -name '.coverage*' -printf '%p ')
4056
echo "Found coverage files: $FILES"
4157
echo "files=$FILES" >> $GITHUB_OUTPUT
4258
43-
- name: Coveralls
59+
- name: Upload to Coveralls
4460
if: matrix.os == 'linux-intel'
4561
uses: coverallsapp/github-action@v2
4662
with:
4763
files: ${{ steps.get-coverage-files.outputs.files }}
48-
format: lcov
4964

5065
build-sdist:
5166
name: Build source distribution
@@ -65,7 +80,7 @@ jobs:
6580

6681
upload-pypi:
6782
name: Publish to PyPI
68-
needs: [build-wheels, build-sdist]
83+
needs: [pre-commit, build-wheels, build-sdist]
6984
runs-on: ubuntu-latest
7085
environment: pypi
7186
permissions:

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ optional = true
7474
[tool.setuptools_scm]
7575

7676
[tool.cibuildwheel]
77+
build = ["cp313-manylinux_x86_64"]
7778
environment-pass = ["RUNNER_OS"]
7879
test-groups = ["dev"]
7980
test-command = [

scripts/save_coverage.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
#!/usr/bin/env python
22

33
import os
4-
import shutil
4+
import re
55
import traceback
66
import uuid
7+
from pathlib import Path
78

89
try:
910
if os.getenv("RUNNER_OS") == "Linux":
11+
coverage = Path("coverage.lcov").read_text()
12+
coverage = re.sub(
13+
r"^(SF:).*?/site-packages/", r"\1src/", coverage, flags=re.MULTILINE
14+
)
1015
os.makedirs("/output", exist_ok=True)
11-
shutil.move("coverage.lcov", f"/output/coverage.{uuid.uuid4().hex}.lcov")
16+
Path(f"/output/.coverage.{uuid.uuid4().hex}.lcov").write_text(coverage)
1217
except Exception:
1318
traceback.print_exc()

0 commit comments

Comments
 (0)