15
15
required : false
16
16
options :
17
17
- ' '
18
- - ' ubuntu-20 .04'
18
+ - ' ubuntu-22 .04'
19
19
- ' macos-13'
20
20
- ' macos-14'
21
21
- ' windows-2022'
49
49
# don't upgrade outdated brew packages because the process is too slow
50
50
HOMEBREW_NO_INSTALL_UPGRADE : 1
51
51
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK : 1
52
+ # apt-get should run in noninteractive mode
53
+ DEBIAN_FRONTEND : noninteractive
52
54
53
55
defaults :
54
56
run :
@@ -64,16 +66,14 @@ jobs:
64
66
strategy :
65
67
fail-fast : false
66
68
matrix :
67
- # Use Ubuntu 20 .04 / macOS 13 x86_64 / macOS 14 arm64 + Python 3.10 to build SpiderMonkey
68
- os : [ 'ubuntu-20 .04', 'macos-13', 'macos-14', 'ubuntu-22.04-arm' ] # macOS 14 runner exclusively runs on M1 hardwares
69
+ # Use Ubuntu 22 .04 / macOS 13 x86_64 / macOS 14 arm64 + Python 3.10 to build SpiderMonkey
70
+ os : [ 'ubuntu-22 .04', 'macos-13', 'macos-14', 'ubuntu-22.04-arm' ] # macOS 14 runner exclusively runs on M1 hardwares
69
71
# see https://github.blog/changelog/2024-01-30-github-actions-macos-14-sonoma-is-now-available
70
72
python_version : [ '3.10' ]
71
73
runs-on : ${{ matrix.os }}
74
+ container : ${{ (matrix.os == 'ubuntu-22.04' && 'ubuntu:20.04') || null }} # Use the Ubuntu 20.04 container inside Ubuntu 22.04 runner to build
72
75
steps :
73
76
- uses : actions/checkout@v4
74
- - uses : actions/setup-python@v5
75
- with :
76
- python-version : ${{ matrix.python_version }}
77
77
- name : Read the mozilla-central commit hash to be used
78
78
run : echo "MOZCENTRAL_VERSION=$(cat mozcentral.version)" >> $GITHUB_ENV
79
79
- name : Cache spidermonkey build
84
84
./_spidermonkey_install/*
85
85
key : spidermonkey-${{ env.MOZCENTRAL_VERSION }}-${{ runner.os }}-${{ runner.arch }}
86
86
lookup-only : true # skip download
87
+ - name : Setup container
88
+ if : ${{ matrix.os == 'ubuntu-22.04' && steps.cache-spidermonkey.outputs.cache-hit != 'true' }}
89
+ run : |
90
+ apt-get update -y
91
+ apt-get install -y sudo libnss3-dev libssl-dev
92
+ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata
93
+ echo "AGENT_TOOLSDIRECTORY=/" >> $GITHUB_ENV # do not use the Python installation cached for Ubuntu 22.04
94
+ - uses : actions/setup-python@v5
95
+ if : ${{ steps.cache-spidermonkey.outputs.cache-hit != 'true' }}
96
+ with :
97
+ python-version : ${{ matrix.python_version }}
87
98
- name : Setup XCode
88
99
if : ${{ matrix.os == 'macos-13' && steps.cache-spidermonkey.outputs.cache-hit != 'true' }}
89
100
# SpiderMonkey requires XCode SDK version at least 13.3
@@ -132,10 +143,28 @@ jobs:
132
143
strategy :
133
144
fail-fast : false
134
145
matrix :
135
- os : [ 'ubuntu-20 .04', 'macos-13', 'macos-14', 'windows-2022', 'ubuntu-22.04-arm' ]
146
+ os : [ 'ubuntu-22 .04', 'macos-13', 'macos-14', 'windows-2022', 'ubuntu-22.04-arm' ]
136
147
python_version : [ '3.8', '3.9', '3.10', '3.11', '3.12', '3.13' ]
137
148
runs-on : ${{ matrix.os }}
149
+ container : ${{ (matrix.os == 'ubuntu-22.04' && 'ubuntu:20.04') || null }}
138
150
steps :
151
+ - name : Setup container
152
+ if : ${{ matrix.os == 'ubuntu-22.04' }}
153
+ run : |
154
+ apt-get update -y
155
+ apt-get install -y sudo libnss3-dev libssl-dev
156
+ apt-get install -y git # required for `actions/checkout`
157
+ apt-get install -y build-essential
158
+ apt-get install -y strace # required to run JS tests
159
+ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata # tzdata may ask for user interaction if not explicitly installed here
160
+ echo "AGENT_TOOLSDIRECTORY=/" >> $GITHUB_ENV # do not use the Python installation cached for Ubuntu 22.04
161
+ git config --global --add safe.directory '*' # silence "git failed because of dubious ownership"
162
+
163
+ # CMake 3.25 or higher is required
164
+ apt-get install -y ca-certificates gpg wget
165
+ wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null
166
+ echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ focal main' | sudo tee /etc/apt/sources.list.d/kitware.list >/dev/null
167
+ apt-get update -y && apt-get install -y cmake
139
168
- uses : actions/checkout@v4
140
169
with :
141
170
submodules : recursive
@@ -166,7 +195,7 @@ jobs:
166
195
env :
167
196
PYTHON_VERSION : ${{ matrix.python_version }}
168
197
- name : Build Docs # only build docs once
169
- if : ${{ matrix.os == 'ubuntu-20 .04' && matrix.python_version == '3.11' }}
198
+ if : ${{ matrix.os == 'ubuntu-22 .04' && matrix.python_version == '3.11' }}
170
199
run : |
171
200
sudo apt-get install -y graphviz
172
201
# the newest version in Ubuntu 20.04 repository is 1.8.17, but we need Doxygen 1.9 series
@@ -176,7 +205,7 @@ jobs:
176
205
rm -rf doxygen-1.9.7 doxygen-1.9.7.linux.bin.tar.gz
177
206
BUILD_DOCS=1 BUILD_TYPE=None poetry install
178
207
- name : Upload Doxygen-generated docs as CI artifacts
179
- if : ${{ matrix.os == 'ubuntu-20 .04' && matrix.python_version == '3.11' }}
208
+ if : ${{ matrix.os == 'ubuntu-22 .04' && matrix.python_version == '3.11' }}
180
209
uses : actions/upload-artifact@v4
181
210
with :
182
211
name : docs-${{ github.run_id }}-${{ github.sha }}
@@ -219,49 +248,22 @@ jobs:
219
248
with :
220
249
name : wheel-${{ github.run_id }}-${{ github.sha }}-${{ runner.os }}_${{ runner.arch }}_Python${{ matrix.python_version }}
221
250
path : ./dist/
222
- - name : Set cores to get stored in /cores
223
- if : ${{ matrix.os != 'windows-2022' }}
224
- # TODO (Caleb Aikens) figure out how to get Windows core dumps
225
- run : |
226
- sudo mkdir -p /cores
227
- sudo chmod 777 /cores
228
- # Core filenames will be of the form osname.pythonversion.executable.pid.timestamp:
229
- if [[ "$OSTYPE" == "linux-gnu"* ]]; then
230
- sudo bash -c 'echo "/cores/${OSTYPE}.$(poetry run python --version).%e.%p.%t" > /proc/sys/kernel/core_pattern'
231
- else
232
- sudo sysctl kern.corefile="/cores/${OSTYPE}.$(poetry run python --version).%e.%p.%y"
233
- fi
234
251
- name : Run Python tests (pytest)
235
252
run : |
236
- if [[ "$OSTYPE" == "linux-gnu"* || "$OSTYPE" == "darwin"* ]]; then
237
- # TODO (Caleb Aikens) figure out how to get Windows core dumps
238
- ulimit -c unlimited
239
- fi
240
253
WORKFLOW_BUILD_TYPE=${{ inputs.build_type }}
241
254
BUILD_TYPE=${WORKFLOW_BUILD_TYPE:-"Debug"} poetry run python -m pip install --force-reinstall --verbose ./dist/*
242
255
poetry run python -m pytest tests/python
243
256
- name : Run JS tests (peter-jr)
244
257
if : ${{ (success() || failure()) }}
245
258
run : |
246
- if [[ "$OSTYPE" == "linux-gnu"* || "$OSTYPE" == "darwin"* ]]; then
247
- # TODO (Caleb Aikens) figure out how to get Windows core dumps
248
- ulimit -c unlimited
249
- fi
250
259
poetry run bash ./peter-jr ./tests/js/
251
260
- name : SSH debug session
252
261
if : ${{ (success() || failure()) && github.event_name == 'workflow_dispatch' && inputs.debug_enabled_os == matrix.os && inputs.debug_enabled_python == matrix.python_version}}
253
262
uses : fawazahmed0/action-debug@main
254
263
with :
255
264
credentials : " admin:admin"
256
- - name : Upload core dumps as CI artifacts
257
- uses : actions/upload-artifact@v4
258
- if : ${{ matrix.os != 'windows-2022' && failure() }}
259
- # TODO (Caleb Aikens) figure out how to get Windows core dumps
260
- with :
261
- name : cores-${{ matrix.os }}-${{ matrix.python_version }}
262
- path : /cores
263
265
sdist :
264
- runs-on : ubuntu-20 .04
266
+ runs-on : ubuntu-22 .04
265
267
steps :
266
268
- uses : actions/checkout@v4
267
269
with :
@@ -283,22 +285,9 @@ jobs:
283
285
with :
284
286
name : wheel-${{ github.run_id }}-${{ github.sha }}-sdist
285
287
path : ./dist/
286
- check-install-from-sdist :
287
- needs : sdist
288
- runs-on : ubuntu-24.04
289
- steps :
290
- - uses : actions/setup-python@v5
291
- with :
292
- python-version : ' 3.10'
293
- - name : Download wheels built
294
- uses : actions/download-artifact@v4
295
- with :
296
- name : wheel-${{ github.run_id }}-${{ github.sha }}-sdist
297
- path : ./dist/
298
- - run : pip install ./dist/pythonmonkey-*.tar.gz
299
288
publish :
300
289
needs : [build-and-test, sdist]
301
- runs-on : ubuntu-20 .04
290
+ runs-on : ubuntu-22 .04
302
291
if : ${{ success() && github.event_name == 'push' && github.ref_type == 'tag' }}
303
292
steps :
304
293
# no need to checkout
@@ -322,7 +311,7 @@ jobs:
322
311
# Implement a very basic Python package repository (https://peps.python.org/pep-0503/)
323
312
# and deploy the static files to GitHub Pages
324
313
needs : [build-and-test, sdist]
325
- runs-on : ubuntu-20 .04
314
+ runs-on : ubuntu-22 .04
326
315
if : ${{ (success() || failure()) && (github.ref_name == 'main' || github.ref_type == 'tag') }} # publish nightly builds regardless of tests failure
327
316
permissions : # grant GITHUB_TOKEN the permissions required to make a Pages deployment
328
317
pages : write
@@ -382,7 +371,7 @@ jobs:
382
371
publish-archive :
383
372
# Publish to ⊇istributive's archive server (https://archive.distributed.computer/releases/pythonmonkey/)
384
373
needs : [build-and-test, sdist]
385
- runs-on : ubuntu-20 .04
374
+ runs-on : ubuntu-22 .04
386
375
if : ${{ (success() || failure()) && (github.ref_name == 'main' || github.ref_type == 'tag') }}
387
376
environment :
388
377
name : archive
0 commit comments