Skip to content

Commit a93e570

Browse files
authored
Merge pull request #5438 from NREL/actions_pypi
Fixup Python Bindings workflow + add an ubuntu-22.04-arm runner
2 parents a62d54f + 597e46e commit a93e570

File tree

1 file changed

+37
-10
lines changed

1 file changed

+37
-10
lines changed

.github/workflows/python_bindings.yml

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,22 @@ jobs:
2525
# fail-fast: Default is true, switch to false to allow one platform to fail and still run others
2626
fail-fast: false
2727
matrix:
28-
name: [Ubuntu, macOS, macOS_arm64, Windows_py37, Windows_py38, Windows_py39, Windows_py310, Windows_py311, Windows_py312, Windows_py313]
28+
name: [Ubuntu, Ubuntu_arm64, macOS, macOS_arm64, Windows_py37, Windows_py38, Windows_py39, Windows_py310, Windows_py311, Windows_py312, Windows_py313]
2929
include:
3030
- name: Ubuntu
3131
os: ubuntu-22.04
3232
python-version: 3.8
3333
allow_failure: false
34+
- name: Ubuntu_arm64
35+
os: ubuntu-22.04-arm
36+
python-version: 3.8
37+
allow_failure: true
3438
- name: macOS
35-
os: macos-12
39+
os: macos-13
3640
python-version: 3.8
3741
allow_failure: false
3842
MACOSX_DEPLOYMENT_TARGET: 10.15
39-
SDKROOT: /Applications/Xcode_13.2.1.app
43+
SDKROOT: /Applications/Xcode_15.2.app
4044
- name: macOS_arm64
4145
os: macos-14
4246
python-version: 3.8
@@ -69,7 +73,7 @@ jobs:
6973
allow_failure: false
7074
- name: Windows_py313
7175
os: windows-2019
72-
python-version: '3.13'
76+
python-version: '3.13.5'
7377
allow_failure: true # Possible this fails, don't care yet
7478

7579
steps:
@@ -283,13 +287,24 @@ jobs:
283287
if [ "${{ matrix.name }}" == "macOS_arm64" ]; then
284288
PYTHON_ARCH=arm64
285289
# Avoid "builtin __has_nothrow_assign is deprecated; use __is_nothrow_assignable instead" in boost/1.79 with recent clang
286-
conan install . --output-folder=./build --build=missing -c tools.cmake.cmaketoolchain:generator=Ninja -s compiler.cppstd=20 -s build_type=Release -o with_testing=False -o with_benchmark=False -c tools.build:cxxflags="['-D_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION -Wno-enum-constexpr-conversion']"
290+
conan install . --output-folder=./build --build=missing \
291+
-c tools.cmake.cmaketoolchain:generator=Ninja -s compiler.cppstd=20 -s build_type=Release \
292+
-o with_testing=False -o with_benchmark=False -o with_ruby=False \
293+
-c tools.build:cxxflags="['-D_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION -Wno-enum-constexpr-conversion']"
287294
else
288-
conan install . --output-folder=./build --build=missing -c tools.cmake.cmaketoolchain:generator=Ninja -s compiler.cppstd=20 -s build_type=Release -o with_testing=False -o with_benchmark=False -c tools.build:cxxflags="['-D_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION']"
295+
conan install . --output-folder=./build --build=missing \
296+
-c tools.cmake.cmaketoolchain:generator=Ninja -s compiler.cppstd=20 -s build_type=Release \
297+
-o with_testing=False -o with_benchmark=False -o with_ruby=False \
298+
-c tools.build:cxxflags="['-D_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION']"
289299
fi
290300
else
301+
if [ "${{ matrix.name }}" == "Ubuntu_arm64" ]; then
302+
PYTHON_ARCH=arm64
303+
fi
291304
PYTHON_VERSION=${{ steps.setup-python.outputs.python-version }}
292-
conan install . --output-folder=./build --build=missing -c tools.cmake.cmaketoolchain:generator=Ninja -s compiler.cppstd=20 -s build_type=Release -o with_testing=False -o with_benchmark=False
305+
conan install . --output-folder=./build --build=missing \
306+
-c tools.cmake.cmaketoolchain:generator=Ninja -s compiler.cppstd=20 -s build_type=Release \
307+
-o with_testing=False -o with_benchmark=False -o with_ruby=False
293308
fi
294309
echo -e "::endgroup::"
295310
@@ -302,7 +317,15 @@ jobs:
302317
echo -e "::endgroup::"
303318
304319
begin_group "Build"
305-
cmake --build --preset conan-release
320+
if [ "${{ matrix.name }}" == "Ubuntu_arm64" ]; then
321+
echo "Ubuntu_arm64 is apparently running out of memory/CPU during the build as of 2025-06-18, so work around it"
322+
N=$(nproc)
323+
cmake --build --preset conan-release --target openstudiolib -j $N
324+
cmake --build --preset conan-release --target python_sdk -j $(($N - 2))
325+
cmake --build --preset conan-release -j $(($N - 2))
326+
else
327+
cmake --build --preset conan-release
328+
fi
306329
echo -e "::endgroup::"
307330
308331
@@ -385,14 +408,18 @@ jobs:
385408
# fail-fast: Default is true, switch to false to allow one platform to fail and still run others
386409
fail-fast: false
387410
matrix:
388-
name: [Ubuntu, macOS, macOS_arm64, Windows_py37, Windows_py38, Windows_py39, Windows_py310, Windows_py311, Windows_py312, Windows_py313]
411+
name: [Ubuntu, Ubuntu_arm64, macOS, macOS_arm64, Windows_py37, Windows_py38, Windows_py39, Windows_py310, Windows_py311, Windows_py312, Windows_py313]
389412
include:
390413
- name: Ubuntu
391414
os: ubuntu-22.04
392415
python-version: 3.11 # Voluntarily using a newer version than built with for Unix
393416
allow_failure: false
417+
- name: Ubuntu_arm64
418+
os: ubuntu-22.04-arm
419+
python-version: 3.12
420+
allow_failure: true
394421
- name: macOS
395-
os: macos-12
422+
os: macos-13
396423
python-version: 3.11
397424
allow_failure: false
398425
- name: macOS_arm64

0 commit comments

Comments
 (0)