forked from AcademySoftwareFoundation/openexr
-
Notifications
You must be signed in to change notification settings - Fork 0
131 lines (114 loc) · 3.32 KB
/
python-wheels.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) Contributors to the OpenEXR Project.
#
name: Python Wheels
on:
push:
branches-ignore:
- RB-2.*
tags-ignore:
- v1.*
- v2.*
paths:
- '**'
- '!**.md'
- '!website/**'
- 'website/src/**'
- '!bazel/**'
pull_request:
branches-ignore:
- RB-2.*
tags-ignore:
- v1.*
- v2.*
paths:
- '**'
- '!**.md'
- '!website/**'
- 'website/src/**'
- '!bazel/**'
permissions:
contents: read
jobs:
build_openexr_libraries:
name: Build OpenEXR Libraries
runs-on: ${{ matrix.os }}
strategy:
matrix:
### os: [ubuntu-22.04, windows-latest, macOS-latest]
os: [ubuntu-22.04]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Create build directories
run: |
mkdir _build
mkdir _install
- name: Configure
run: |
cmake .. \
-DCMAKE_INSTALL_PREFIX=../_install \
-DCMAKE_VERBOSE_MAKEFILE:BOOL='ON' \
-DBUILD_TESTING='OFF' \
-DOPENEXR_BUILD_TOOLS='OFF' \
-DOPENEXR_INSTALL_TOOLS='OFF' \
-DOPENEXR_INSTALL_DOCS='OFF' \
-DOPENEXR_INSTALL_EXAMPLES='OFF'
working-directory: _build
- name: Build & Install
run: |
cmake --build . \
--target install
working-directory: _build
- uses: actions/cache@v3
id: restore-build
with:
path: |
_install/*
src/wrappers/python/*
key: ${{ runner.os }}-install-${{ github.sha }}
restore-keys: ${{ runner.os }}-install-
build_wheels:
name: Build Python wheels
needs: build_openexr_libraries
runs-on: ${{ matrix.os }}
strategy:
matrix:
### os: [ubuntu-22.04, windows-latest, macOS-latest]
os: [ubuntu-22.04]
env:
# On macOS we build both x86 and arm to support Intel and Apple Silicon.
CIBW_ARCHS_MACOS: x86_64 arm64
# Skip 32-bit wheels builds on Windows.
# Also skip the PyPy builds, since they fail the unittests
CIBW_SKIP: "*-win32 *_i686 pp*"
# The CI platform is Intel based so we are doing cross compilation
# for arm64. It is not currently possible to test arm64 when cross
# compiling.
CIBW_TEST_SKIP: "*_arm64"
CIBW_TEST_REQUIRES: pytest
CIBW_TEST_COMMAND: pytest {project}/src/wrappers/python/tests/
XXX_CMAKE_PREFIX_PATH: ${{github.workspace}}/_install
steps:
- uses: actions/cache@v3
id: restore-build
with:
path: |
_install/*
src/wrappers/python/*
key: ${{ runner.os }}-install-${{ github.sha }}
restore-keys: ${{ runner.os }}-install-
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.16.2
- name: Build wheels
run: |
find .
cd src/wrappers/python
env CMAKE_PREFIX_PATH=${{github.workspace}}/_install python -m cibuildwheel --output-dir wheelhouse
- uses: actions/upload-artifact@v3
with:
name: "Python wheels"
path: ./wheelhouse/*.whl