8
8
- ' *'
9
9
workflow_call :
10
10
workflow_dispatch :
11
+ inputs :
12
+ debug_enabled_os :
13
+ type : choice
14
+ description : Optionally, choose an OS to run the build with SSH debugging on (https://github.com/fawazahmed0/action-debug)
15
+ required : false
16
+ options :
17
+ - ' '
18
+ - ' ubuntu-20.04'
19
+ - ' macos-12'
20
+ - ' macos-13'
21
+ - ' macos-14'
22
+ - ' windows-2019'
23
+ debug_enabled_python :
24
+ type : choice
25
+ description : Choose a Python version to run the build with SSH debugging on
26
+ required : false
27
+ options :
28
+ - ' '
29
+ - ' 3.8'
30
+ - ' 3.9'
31
+ - ' 3.10'
32
+ - ' 3.11'
33
+ - ' 3.12'
34
+ build_type :
35
+ type : choice
36
+ description : ' Choose the build type to use'
37
+ required : false
38
+ default : ' Debug'
39
+ options :
40
+ - ' Debug'
41
+ - ' Profile'
42
+ - ' Sanitize'
43
+ - ' DRelease'
44
+ - ' Release'
45
+ - ' None'
11
46
pull_request :
12
47
13
48
env :
@@ -31,17 +66,17 @@ jobs:
31
66
python_version : [ '3.10' ]
32
67
runs-on : ${{ matrix.os }}
33
68
steps :
34
- - uses : actions/checkout@v3
35
- - uses : actions/setup-python@v4
69
+ - uses : actions/checkout@v4
70
+ - uses : actions/setup-python@v5
36
71
with :
37
72
python-version : ${{ matrix.python_version }}
38
73
- name : Cache spidermonkey build
39
74
id : cache-spidermonkey
40
- uses : actions/cache@v3
75
+ uses : actions/cache@v4
41
76
with :
42
77
path : |
43
78
./_spidermonkey_install/*
44
- key : spidermonkey115.7 .0-${{ runner.os }}-${{ runner.arch }}
79
+ key : spidermonkey115.8 .0-${{ runner.os }}-${{ runner.arch }}
45
80
lookup-only : true # skip download
46
81
- name : Setup XCode
47
82
if : ${{ (matrix.os == 'macos-13' || matrix.os == 'macos-14') && steps.cache-spidermonkey.outputs.cache-hit != 'true' }}
@@ -54,14 +89,14 @@ jobs:
54
89
build-spidermonkey-win :
55
90
runs-on : windows-2019
56
91
steps :
57
- - uses : actions/checkout@v3
92
+ - uses : actions/checkout@v4
58
93
- name : Cache spidermonkey build
59
94
id : cache-spidermonkey
60
- uses : actions/cache@v3
95
+ uses : actions/cache@v4
61
96
with :
62
97
path : |
63
98
./_spidermonkey_install/*
64
- key : spidermonkey115.7 .0-${{ runner.os }}-${{ runner.arch }}
99
+ key : spidermonkey115.8 .0-${{ runner.os }}-${{ runner.arch }}
65
100
lookup-only : true # skip download
66
101
- name : Install dependencies
67
102
if : ${{ steps.cache-spidermonkey.outputs.cache-hit != 'true' }}
@@ -89,11 +124,10 @@ jobs:
89
124
fail-fast : false
90
125
matrix :
91
126
# The lowest supported version is Ubuntu 20.04 + Python 3.8 or macOS 12 + Python 3.9
92
- os : [ 'ubuntu-20.04', 'macos-12', 'windows-2019 ', 'macos-14' ]
127
+ os : [ 'ubuntu-20.04', 'macos-12', 'macos-13 ', 'macos-14', 'windows-2019 ' ]
93
128
python_version : [ '3.8', '3.9', '3.10', '3.11', '3.12' ]
94
129
exclude :
95
130
# macOS 12 comes with Python 3.9 by default, so we drop ci support for Python 3.8 on macOS
96
- # FIXME: We can't build on macOS 11 for now because our prebuilt `uncrustify` binary requires macOS 12
97
131
- os : ' macos-12'
98
132
python_version : ' 3.8'
99
133
# actions/setup-python: The version '3.8'/'3.9' with architecture 'arm64' was not found for macOS.
@@ -104,12 +138,12 @@ jobs:
104
138
python_version : ' 3.9'
105
139
runs-on : ${{ matrix.os }}
106
140
steps :
107
- - uses : actions/checkout@v3
141
+ - uses : actions/checkout@v4
108
142
with :
109
143
submodules : recursive
110
144
fetch-depth : 0 # fetch all history for all branches and tags
111
145
# poetry-dynamic-versioning needs git tags to produce the correct version number
112
- - uses : actions/setup-python@v4
146
+ - uses : actions/setup-python@v5
113
147
with :
114
148
python-version : ${{ matrix.python_version }}
115
149
- name : Setup Poetry
@@ -122,27 +156,21 @@ jobs:
122
156
if [[ "$OSTYPE" == "linux-gnu"* ]]; then # Linux
123
157
sudo apt-get update -y
124
158
sudo apt-get install -y cmake graphviz llvm
125
- # Install Doxygen
126
- # the newest version in Ubuntu 20.04 repository is 1.8.17, but we need Doxygen 1.9 series
127
- wget -c -q https://www.doxygen.nl/files/doxygen-1.9.7.linux.bin.tar.gz
128
- tar xf doxygen-1.9.7.linux.bin.tar.gz
129
- cd doxygen-1.9.7 && sudo make install && cd -
130
- rm -rf doxygen-1.9.7 doxygen-1.9.7.linux.bin.tar.gz
131
159
elif [[ "$OSTYPE" == "darwin"* ]]; then # macOS
132
160
brew update || true # allow failure
133
- brew install cmake doxygen graphviz pkg-config wget coreutils # `coreutils` installs the `realpath` command
161
+ brew install cmake pkg-config wget coreutils # `coreutils` installs the `realpath` command
134
162
fi
135
163
echo "Installing python deps"
136
164
poetry self add "poetry-dynamic-versioning[plugin]"
137
165
poetry env use python3 # use the correct Python version we've set up
138
166
poetry install --no-root --only=dev
139
167
echo "Installed Dependencies"
140
168
- name : Use cached spidermonkey build
141
- uses : actions/cache@v3
169
+ uses : actions/cache@v4
142
170
with :
143
171
path : |
144
172
./_spidermonkey_install/*
145
- key : spidermonkey115.7 .0-${{ runner.os }}-${{ runner.arch }}
173
+ key : spidermonkey115.8 .0-${{ runner.os }}-${{ runner.arch }}
146
174
fail-on-cache-miss : true # SpiderMonkey is expected to be cached in its dedicated job
147
175
- name : Build pminit
148
176
run : |
@@ -154,33 +182,62 @@ jobs:
154
182
- name : Build wheel
155
183
run : |
156
184
echo $(poetry run python --version)
157
- poetry build --format=wheel
185
+ WORKFLOW_BUILD_TYPE=${{ inputs.build_type }}
186
+ BUILD_TYPE=${WORKFLOW_BUILD_TYPE:-"Debug"} poetry build --format=wheel
158
187
ls -lah ./dist/
159
188
- name : Upload wheel as CI artifacts
160
189
uses : actions/upload-artifact@v3
161
190
with :
162
191
name : wheel-${{ github.run_id }}-${{ github.sha }}
163
192
path : ./dist/
164
- - name : Upload Doxygen-generated docs as CI artifacts
165
- uses : actions/upload-artifact@v3
166
- if : ${{ matrix.os == 'ubuntu-20.04' && matrix.python_version == '3.11' }} # making sure we only upload once
167
- with :
168
- name : docs-${{ github.run_id }}-${{ github.sha }}
169
- path : ./build/docs/html/
193
+ - name : Set cores to get stored in /cores
194
+ if : ${{ matrix.os != 'windows-2019' }}
195
+ # TODO (Caleb Aikens) figure out how to get Windows core dumps
196
+ run : |
197
+ sudo mkdir -p /cores
198
+ sudo chmod 777 /cores
199
+ # Core filenames will be of the form osname.pythonversion.executable.pid.timestamp:
200
+ if [[ "$OSTYPE" == "linux-gnu"* ]]; then
201
+ sudo bash -c 'echo "/cores/${OSTYPE}.$(poetry run python --version).%e.%p.%t" > /proc/sys/kernel/core_pattern'
202
+ else
203
+ sudo sysctl kern.corefile="/cores/${OSTYPE}.$(poetry run python --version).%e.%p.%y"
204
+ fi
170
205
- name : Run Python tests (pytest)
171
206
run : |
172
- poetry run python -m pip install --force-reinstall --verbose ./dist/*
207
+ if [[ "$OSTYPE" == "linux-gnu"* || "$OSTYPE" == "darwin"* ]]; then
208
+ # TODO (Caleb Aikens) figure out how to get Windows core dumps
209
+ ulimit -c unlimited
210
+ fi
211
+ WORKFLOW_BUILD_TYPE=${{ inputs.build_type }}
212
+ BUILD_TYPE=${WORKFLOW_BUILD_TYPE:-"Debug"} poetry run python -m pip install --force-reinstall --verbose ./dist/*
173
213
poetry run python -m pytest tests/python
174
214
- name : Run JS tests (peter-jr)
215
+ if : ${{ (success() || failure()) }}
175
216
run : |
217
+ if [[ "$OSTYPE" == "linux-gnu"* || "$OSTYPE" == "darwin"* ]]; then
218
+ # TODO (Caleb Aikens) figure out how to get Windows core dumps
219
+ ulimit -c unlimited
220
+ fi
176
221
poetry run bash ./peter-jr ./tests/js/
222
+ - name : SSH debug session
223
+ if : ${{ (success() || failure()) && github.event_name == 'workflow_dispatch' && inputs.debug_enabled_os == matrix.os && inputs.debug_enabled_python == matrix.python_version}}
224
+ uses : fawazahmed0/action-debug@main
225
+ with :
226
+ credentials : " admin:admin"
227
+ - name : Upload core dumps as CI artifacts
228
+ uses : actions/upload-artifact@v3
229
+ if : ${{ matrix.os != 'windows-2019' && failure() }}
230
+ # TODO (Caleb Aikens) figure out how to get Windows core dumps
231
+ with :
232
+ name : cores-${{ matrix.os }}-${{ matrix.python_version }}
233
+ path : /cores
177
234
sdist :
178
235
runs-on : ubuntu-20.04
179
236
steps :
180
- - uses : actions/checkout@v3
237
+ - uses : actions/checkout@v4
181
238
with :
182
239
fetch-depth : 0
183
- - uses : actions/setup-python@v4
240
+ - uses : actions/setup-python@v5
184
241
with :
185
242
python-version : ' 3.9'
186
243
- name : Setup Poetry
@@ -189,21 +246,33 @@ jobs:
189
246
version : 1.5.1
190
247
- name : Build source distribution (sdist) file
191
248
run : |
249
+ # Install Doxygen
250
+ # the newest version in Ubuntu 20.04 repository is 1.8.17, but we need Doxygen 1.9 series
251
+ wget -c -q https://www.doxygen.nl/files/doxygen-1.9.7.linux.bin.tar.gz
252
+ tar xf doxygen-1.9.7.linux.bin.tar.gz
253
+ cd doxygen-1.9.7 && sudo make install && cd -
254
+ rm -rf doxygen-1.9.7 doxygen-1.9.7.linux.bin.tar.gz
192
255
poetry self add "poetry-dynamic-versioning[plugin]"
256
+ BUILD_DOCS=1 BUILD_TYPE=None poetry install
193
257
poetry build --format=sdist
194
258
ls -lah ./dist/
195
259
- name : Upload sdist as CI artifacts
196
260
uses : actions/upload-artifact@v3
197
261
with :
198
262
name : wheel-${{ github.run_id }}-${{ github.sha }}
199
263
path : ./dist/
264
+ - name : Upload Doxygen-generated docs as CI artifacts
265
+ uses : actions/upload-artifact@v3
266
+ with :
267
+ name : docs-${{ github.run_id }}-${{ github.sha }}
268
+ path : ./build/docs/html/
200
269
publish :
201
270
needs : [build-and-test, sdist]
202
271
runs-on : ubuntu-20.04
203
272
if : ${{ success() && github.event_name == 'push' && contains(github.ref, 'refs/tags/') }}
204
273
steps :
205
274
# no need to checkout
206
- - uses : actions/setup-python@v4
275
+ - uses : actions/setup-python@v5
207
276
with :
208
277
python-version : ' 3.9'
209
278
- run : pip install twine
0 commit comments