-
Notifications
You must be signed in to change notification settings - Fork 2
242 lines (240 loc) · 8.78 KB
/
cd.yml
File metadata and controls
242 lines (240 loc) · 8.78 KB
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
name: CD
on:
pull_request:
branches: [ main ]
push:
branches: [ main ]
release:
types: [ created ]
workflow_dispatch:
jobs:
# libraries:
# name: ${{ matrix.name }}
# runs-on: ${{ matrix.os }}
# strategy:
# fail-fast: false
# matrix:
# include:
# - name: 'Windows static library (Intel) (Release)'
# os: windows-2022
# arch: amd64
# build_type: Release
# shared_libs: OFF
# - name: 'Windows shared library (Intel) (Release)'
# os: windows-2022
# arch: amd64
# build_type: Release
# shared_libs: ON
# - name: 'Windows shared library (Intel) (Debug)'
# os: windows-2022
# arch: amd64
# build_type: Debug
# shared_libs: ON
# - name: 'Windows static library (ARM) (Release)'
# os: windows-11-arm
# arch: amd64_arm64
# build_type: Release
# shared_libs: OFF
# - name: 'Windows shared library (ARM) (Release)'
# os: windows-11-arm
# arch: amd64_arm64
# build_type: Release
# shared_libs: ON
# - name: 'Windows shared library (ARM) (Debug)'
# os: windows-11-arm
# arch: amd64_arm64
# build_type: Debug
# shared_libs: ON
# - name: 'Linux static library (Intel)'
# os: ubuntu-22.04
# build_type: Release
# shared_libs: OFF
# - name: 'Linux shared library (Intel)'
# os: ubuntu-22.04
# build_type: Release
# shared_libs: ON
# - name: 'Linux static library (ARM)'
# os: ubuntu-22.04-arm
# build_type: Release
# shared_libs: OFF
# - name: 'Linux shared library (ARM)'
# os: ubuntu-22.04-arm
# build_type: Release
# shared_libs: ON
# - name: 'macOS static library (Intel)'
# os: macos-14
# arch: Intel # Only used for buildcache's cache key.
# build_type: Release
# shared_libs: OFF
# target_arch: " -DTARGET_ARCHITECTURE=Intel"
# - name: 'macOS shared library (Intel)'
# os: macos-14
# arch: Intel # Only used for buildcache's cache key.
# build_type: Release
# shared_libs: ON
# target_arch: " -DTARGET_ARCHITECTURE=Intel"
# - name: 'macOS static library (ARM)'
# os: macos-14
# arch: ARM # Only used for buildcache's cache key.
# build_type: Release
# shared_libs: OFF
# - name: 'macOS shared library (ARM)'
# os: macos-14
# arch: ARM # Only used for buildcache's cache key.
# build_type: Release
# shared_libs: ON
# env:
# BUILDCACHE_ACCURACY: STRICT
# BUILDCACHE_COMPRESS_FORMAT: ZSTD
# BUILDCACHE_DEBUG: -1
# BUILDCACHE_LOG_FILE: ""
# steps:
# - name: Set the timezone to New Zealand
# uses: szenius/set-timezone@v2.0
# with:
# timezoneWindows: 'New Zealand Standard Time'
# timezoneLinux: 'Pacific/Auckland'
# timezoneMacos: 'Pacific/Auckland'
# - name: Check out libOpenCOR
# uses: actions/checkout@v4
# - name: Install CMake and Ninja
# uses: lukka/get-cmake@latest
# - name: Install buildcache
# uses: opencor/buildcache-action@v1
# with:
# cache_key: cd-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.build_type }}-${{ matrix.shared_libs }}
# - name: Configure MSVC
# if: ${{ runner.os == 'Windows' }}
# uses: ilammy/msvc-dev-cmd@v1
# with:
# arch: ${{ matrix.arch }}
# - name: Configure libOpenCOR
# run: |
# mkdir build
# cd build
# cmake -G Ninja ${{ matrix.target_arch }} -DBUILD_TYPE=${{ matrix.build_type }} -DCODE_ANALYSIS=OFF -DCODE_COVERAGE=OFF -DDOCUMENTATION=OFF -DJAVASCRIPT_BINDINGS=OFF -DMEMORY_CHECKS=OFF -DPYTHON_BINDINGS=OFF -DPYTHON_UNIT_TESTING=OFF -DSHARED_LIBS=${{ matrix.shared_libs }} -DUNIT_TESTING=OFF ..
# - name: Build libOpenCOR
# run: |
# cd build
# ninja
# - name: Package libOpenCOR
# run: |
# cd build
# cpack
# - name: Upload libOpenCOR artifacts
# if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
# uses: actions/upload-artifact@v4
# with:
# name: ${{ matrix.name }}
# path: ./build/libOpenCOR-*
# - name: Release libOpenCOR
# if: ${{ startsWith(github.ref, 'refs/tags/v') }}
# uses: softprops/action-gh-release@v2
# with:
# files: ./build/libOpenCOR-*
python_wheels:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
# - name: 'Windows Python wheels (Intel)'
# os: windows-2022
# arch: amd64
# - name: 'Windows Python wheels (ARM)'
# os: windows-11-arm
# arch: amd64_arm64
- name: 'Linux Python wheels (Intel)'
os: ubuntu-22.04
- name: 'Linux Python wheels (ARM)'
os: ubuntu-22.04-arm
# - name: 'macOS Python wheels (Intel)'
# os: macos-13
# - name: 'macOS Python wheels (ARM)'
# os: macos-14
steps:
- name: Set the timezone to New Zealand
uses: szenius/set-timezone@v2.0
with:
timezoneWindows: 'New Zealand Standard Time'
timezoneLinux: 'Pacific/Auckland'
timezoneMacos: 'Pacific/Auckland'
- name: Check out libOpenCOR
uses: actions/checkout@v4
- name: Configure MSVC
if: ${{ runner.os == 'Windows' }}
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.arch }}
- name: Build Python wheels
uses: pypa/cibuildwheel@v2.23.3
env:
CIBW_ARCHS: auto64
CIBW_BEFORE_ALL_LINUX: >
export USR_LIB_PATH=/usr/lib/`uname -m`-linux-gnu &&
mkdir -p $USR_LIB_PATH &&
cd $USR_LIB_PATH &&
ln -s /usr/lib64/libz.so
CIBW_BUILD: 'cp*'
CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=13.0
# Note #1: the value of CIBW_ENVIRONMENT_MACOS must be in sync with that of MACOS_DEPLOYMENT_TARGET in
# CMakelists.txt.
# Note #2: for some reasons, we need to specify the minor version, hence using 13.0 instead of 13.
CIBW_MANYLINUX_X86_64_IMAGE: quay.io/pypa/manylinux_2_34_x86_64
CIBW_MANYLINUX_AARCH64_IMAGE: quay.io/pypa/manylinux_2_34_aarch64
CIBW_SKIP: 'cp36* cp37* cp38* *musllinux*'
- name: Upload Python wheel artifacts
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.name }}
path: ./wheelhouse/*.whl
- name: Release Python wheels
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
uses: softprops/action-gh-release@v2
with:
files: ./wheelhouse/*.whl
# webassembly:
# name: WebAssembly
# runs-on: macos-14
# env:
# BUILDCACHE_ACCURACY: STRICT
# BUILDCACHE_COMPRESS_FORMAT: ZSTD
# BUILDCACHE_DEBUG: -1
# BUILDCACHE_LOG_FILE: ""
# steps:
# - name: Set the timezone to New Zealand
# uses: szenius/set-timezone@v2.0
# with:
# timezoneMacos: 'Pacific/Auckland'
# - name: Check out libOpenCOR
# uses: actions/checkout@v4
# - name: Install CMake and Ninja
# uses: lukka/get-cmake@latest
# - name: Install buildcache
# uses: opencor/buildcache-action@v1
# with:
# cache_key: cd-webassembly
# - name: Install Emscripten
# run: brew install emscripten
# - name: Configure libOpenCOR
# run: |
# mkdir build
# cd build
# cmake -G Ninja -DBUILD_TYPE=Release -DCODE_ANALYSIS=OFF -DCODE_COVERAGE=OFF -DDOCUMENTATION=OFF -DJAVASCRIPT_BINDINGS=ON -DJAVASCRIPT_UNIT_TESTING=OFF -DMEMORY_CHECKS=OFF -DPYTHON_BINDINGS=OFF -DPYTHON_UNIT_TESTING=OFF -DSHARED_LIBS=OFF -DUNIT_TESTING=OFF ..
# - name: Build WebAssembly
# run: |
# cd build
# ninja
# - name: Upload WebAssembly artifact
# if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
# uses: actions/upload-artifact@v4
# with:
# name: WebAssembly
# path: ./build/libopencor-*
# - name: Release WebAssembly
# if: ${{ startsWith(github.ref, 'refs/tags/v') }}
# uses: softprops/action-gh-release@v2
# with:
# files: ./build/libopencor-*