Skip to content

Commit a32b63d

Browse files
Attempt cibuildwheel workflow
1 parent 4cb9b96 commit a32b63d

File tree

2 files changed

+55
-0
lines changed

2 files changed

+55
-0
lines changed

.github/workflows/buildwheels.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Build Wheels
2+
3+
on: [push, pull_request] # TODO
4+
5+
jobs:
6+
build_wheels:
7+
name: Build wheels on ${{ matrix.os }}
8+
runs-on: ${{ matrix.os }}
9+
strategy:
10+
matrix:
11+
# macos-13 is an intel runner, macos-14 is apple silicon
12+
# windows-2019 is used for 32-bit, windows-latest for 64-bit
13+
os: [ubuntu-latest, windows-2019, windows-latest, macos-13, macos-14]
14+
15+
steps:
16+
# TODO replace build from source with grabbing release binaries
17+
- name: Checkout parent repository
18+
uses: actions/checkout@v4
19+
with:
20+
repository: NTIA/p2108
21+
ref: AddPythonWrapper # Todo remove
22+
23+
- name: Install CMake # (latest stable version)
24+
uses: lukka/get-cmake@latest
25+
26+
- name: "CMake: Build (32-bit)"
27+
if: matrix.os == 'windows-2019'
28+
uses: lukka/run-cmake@v10
29+
with:
30+
configurePreset: release32
31+
configurePresetAdditionalArgs: "['-DBUILD_DOCS=OFF', '-DRUN_TESTS=OFF']"
32+
buildPreset: release32
33+
34+
- name: "CMake: Build (64-bit)"
35+
if: matrix.os != 'windows-2019'
36+
uses: lukka/run-cmake@v10
37+
with:
38+
configurePreset: release64
39+
configurePresetAdditionalArgs: "['-DBUILD_DOCS=OFF', '-DRUN_TESTS=OFF']"
40+
buildPreset: release64
41+
42+
- name: Change to Python wrapper directory
43+
run: cd wrap/python
44+
45+
- name: Build wheels
46+
uses: pypa/[email protected]
47+
48+
- uses: actions/upload-artifact@v4
49+
with:
50+
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
51+
path: ./wheelhouse/*.whl

pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,7 @@ path = "src/ITS/ITU/PSeries/P2108/__init__.py"
6565
[tool.hatch.build.targets.wheel]
6666
packages = ["src/ITS"]
6767
ignore-vcs = true
68+
69+
[tool.cibuildwheel]
70+
test-command = "pytest ."
71+
test-requires = "pytest"

0 commit comments

Comments
 (0)