Skip to content

Commit e686da5

Browse files
Merge pull request #135 from alliander-opensource/feature/refactor-cibuild
2 parents 8baf3fc + b15d5f5 commit e686da5

File tree

2 files changed

+30
-28
lines changed

2 files changed

+30
-28
lines changed

.github/workflows/main.yml

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -109,42 +109,14 @@ jobs:
109109
include:
110110
- platform: linux
111111
os: ubuntu-latest
112-
cc: gcc
113-
cxx: g++
114-
cibw_build: "cp*-manylinux_x86_64 cp*-manylinux_aarch64"
115-
archs: "x86_64 aarch64"
116112
- platform: macos
117113
os: macos-latest
118-
cc: clang
119-
cxx: clang++
120-
cibw_build: cp*-macosx_*
121-
archs: "x86_64 arm64"
122114
- platform: windows
123115
os: windows-latest
124-
cc:
125-
cxx:
126-
cibw_build: cp*-win_amd64
127-
archs: AMD64
128116

129117
runs-on: ${{ matrix.os }}
130118
needs: [build-cpp-test-linux, build-cpp-test-windows, build-cpp-test-macos]
131119

132-
env:
133-
CC: ${{ matrix.cc }}
134-
CXX: ${{ matrix.cxx }}
135-
CIBW_BUILD_VERBOSITY: 1
136-
CIBW_BUILD_FRONTEND: "build"
137-
CIBW_BUILD: ${{ matrix.cibw_build }}
138-
CIBW_ARCHS: ${{ matrix.archs }}
139-
CIBW_TEST_EXTRAS: "dev"
140-
CIBW_TEST_COMMAND: pytest {package}/tests
141-
# Skip trying to test arm64 builds on Intel Macs
142-
CIBW_TEST_SKIP: "*-macosx_arm64 *-macosx_universal2:arm64"
143-
CIBW_ENVIRONMENT_PASS_LINUX: GITHUB_SHA GITHUB_REF GITHUB_RUN_NUMBER CC CXX
144-
MACOSX_DEPLOYMENT_TARGET: 10.15
145-
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
146-
CIBW_MANYLINUX_AARCH64_IMAGE: manylinux2014
147-
148120
steps:
149121
- uses: actions/checkout@v3
150122

@@ -154,6 +126,10 @@ jobs:
154126

155127
- name: Build wheels
156128
uses: pypa/[email protected]
129+
# GitHub Actions specific build parameters
130+
env:
131+
# pass GitHub runner info into Linux container
132+
CIBW_ENVIRONMENT_PASS_LINUX: GITHUB_SHA GITHUB_REF GITHUB_RUN_NUMBER
157133

158134
- name: Keep wheel files
159135
uses: actions/upload-artifact@v3

pyproject.toml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,29 @@ ignore_missing_imports = true
8282
show_column_numbers = true
8383
non_interactive = true
8484
install_types = true
85+
86+
87+
# CI build options
88+
[tool.cibuildwheel]
89+
build-frontend = "build"
90+
build-verbosity = 1
91+
test-extras = ["dev"]
92+
test-command = "pytest {package}/tests"
93+
94+
[tool.cibuildwheel.linux]
95+
build = ["cp*-manylinux_x86_64", "cp*-manylinux_aarch64"]
96+
archs = ["x86_64", "aarch64"]
97+
environment = { CC="gcc", CXX="g++" }
98+
manylinux-x86_64-image = "manylinux2014"
99+
manylinux-aarch64-image = "manylinux2014"
100+
101+
[tool.cibuildwheel.macos]
102+
build = ["cp*-macosx_*"]
103+
archs = ["x86_64", "arm64"]
104+
environment = { CC="clang", CXX="clang++", MACOSX_DEPLOYMENT_TARGET="10.15" }
105+
# Skip trying to test arm64 builds on Intel Macs
106+
test-skip = ["*-macosx_arm64", "*-macosx_universal2:arm64"]
107+
108+
[tool.cibuildwheel.windows]
109+
build = ["cp*-win_amd64"]
110+
archs = ["AMD64"]

0 commit comments

Comments
 (0)