Skip to content

Commit dbcf502

Browse files
SteveDiamondclaude
andcommitted
Run tests before building wheels in CI
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent ab7dace commit dbcf502

File tree

2 files changed

+23
-26
lines changed

2 files changed

+23
-26
lines changed

.github/workflows/build.yml

Lines changed: 21 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,27 @@ concurrency:
1616

1717
jobs:
1818

19+
test:
20+
name: Test
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- uses: actions/setup-python@v5
26+
with:
27+
python-version: '3.12'
28+
29+
- name: Install dependencies and build
30+
run: |
31+
pip install build
32+
pip install .[test]
33+
34+
- name: Run tests
35+
run: pytest tests/ -v
36+
1937
build_wheels:
2038
name: Build wheels on ${{ matrix.os }}
39+
needs: [test]
2140
runs-on: ${{ matrix.os }}
2241
strategy:
2342
matrix:
@@ -41,6 +60,7 @@ jobs:
4160

4261
build_sdist:
4362
name: Build source distribution
63+
needs: [test]
4464
runs-on: ubuntu-latest
4565
steps:
4666
- uses: actions/checkout@v4
@@ -54,33 +74,8 @@ jobs:
5474
path: dist/*.tar.gz
5575
compression-level: 0
5676

57-
test:
58-
name: Test wheels
59-
needs: [build_wheels]
60-
runs-on: ubuntu-latest
61-
steps:
62-
- uses: actions/checkout@v4
63-
64-
- uses: actions/setup-python@v5
65-
with:
66-
python-version: '3.12'
67-
68-
- uses: actions/download-artifact@v4
69-
with:
70-
pattern: cibw-wheels-ubuntu-*
71-
path: dist
72-
merge-multiple: true
73-
74-
- name: Install wheel and test dependencies
75-
run: |
76-
pip install dist/*.whl
77-
pip install "diffcp[test]"
78-
79-
- name: Run tests
80-
run: pytest tests/ -v
81-
8277
upload_pypi:
83-
needs: [build_wheels, build_sdist, test]
78+
needs: [build_wheels, build_sdist]
8479
runs-on: ubuntu-latest
8580
environment: pypi
8681
permissions:

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,3 +518,5 @@ MigrationBackup/
518518
.vscode
519519
.direnv/
520520
.envrc
521+
.claude/*
522+
.claude/

0 commit comments

Comments
 (0)