1515 required : false
1616 options :
1717 - ' '
18- - ' ubuntu-20 .04'
18+ - ' ubuntu-22 .04'
1919 - ' macos-13'
2020 - ' macos-14'
2121 - ' windows-2022'
4949 # don't upgrade outdated brew packages because the process is too slow
5050 HOMEBREW_NO_INSTALL_UPGRADE : 1
5151 HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK : 1
52+ # apt-get should run in noninteractive mode
53+ DEBIAN_FRONTEND : noninteractive
5254
5355defaults :
5456 run :
@@ -64,16 +66,14 @@ jobs:
6466 strategy :
6567 fail-fast : false
6668 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
6971 # see https://github.blog/changelog/2024-01-30-github-actions-macos-14-sonoma-is-now-available
7072 python_version : [ '3.10' ]
7173 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
7275 steps :
7376 - uses : actions/checkout@v4
74- - uses : actions/setup-python@v5
75- with :
76- python-version : ${{ matrix.python_version }}
7777 - name : Read the mozilla-central commit hash to be used
7878 run : echo "MOZCENTRAL_VERSION=$(cat mozcentral.version)" >> $GITHUB_ENV
7979 - name : Cache spidermonkey build
8484 ./_spidermonkey_install/*
8585 key : spidermonkey-${{ env.MOZCENTRAL_VERSION }}-${{ runner.os }}-${{ runner.arch }}
8686 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 }}
8798 - name : Setup XCode
8899 if : ${{ matrix.os == 'macos-13' && steps.cache-spidermonkey.outputs.cache-hit != 'true' }}
89100 # SpiderMonkey requires XCode SDK version at least 13.3
@@ -132,10 +143,28 @@ jobs:
132143 strategy :
133144 fail-fast : false
134145 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' ]
136147 python_version : [ '3.8', '3.9', '3.10', '3.11', '3.12', '3.13' ]
137148 runs-on : ${{ matrix.os }}
149+ container : ${{ (matrix.os == 'ubuntu-22.04' && 'ubuntu:20.04') || null }}
138150 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
139168 - uses : actions/checkout@v4
140169 with :
141170 submodules : recursive
@@ -166,7 +195,7 @@ jobs:
166195 env :
167196 PYTHON_VERSION : ${{ matrix.python_version }}
168197 - 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' }}
170199 run : |
171200 sudo apt-get install -y graphviz
172201 # the newest version in Ubuntu 20.04 repository is 1.8.17, but we need Doxygen 1.9 series
@@ -176,7 +205,7 @@ jobs:
176205 rm -rf doxygen-1.9.7 doxygen-1.9.7.linux.bin.tar.gz
177206 BUILD_DOCS=1 BUILD_TYPE=None poetry install
178207 - 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' }}
180209 uses : actions/upload-artifact@v4
181210 with :
182211 name : docs-${{ github.run_id }}-${{ github.sha }}
@@ -219,49 +248,22 @@ jobs:
219248 with :
220249 name : wheel-${{ github.run_id }}-${{ github.sha }}-${{ runner.os }}_${{ runner.arch }}_Python${{ matrix.python_version }}
221250 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
234251 - name : Run Python tests (pytest)
235252 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
240253 WORKFLOW_BUILD_TYPE=${{ inputs.build_type }}
241254 BUILD_TYPE=${WORKFLOW_BUILD_TYPE:-"Debug"} poetry run python -m pip install --force-reinstall --verbose ./dist/*
242255 poetry run python -m pytest tests/python
243256 - name : Run JS tests (peter-jr)
244257 if : ${{ (success() || failure()) }}
245258 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
250259 poetry run bash ./peter-jr ./tests/js/
251260 - name : SSH debug session
252261 if : ${{ (success() || failure()) && github.event_name == 'workflow_dispatch' && inputs.debug_enabled_os == matrix.os && inputs.debug_enabled_python == matrix.python_version}}
253262 uses : fawazahmed0/action-debug@main
254263 with :
255264 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
263265 sdist :
264- runs-on : ubuntu-20 .04
266+ runs-on : ubuntu-22 .04
265267 steps :
266268 - uses : actions/checkout@v4
267269 with :
@@ -283,22 +285,9 @@ jobs:
283285 with :
284286 name : wheel-${{ github.run_id }}-${{ github.sha }}-sdist
285287 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
299288 publish :
300289 needs : [build-and-test, sdist]
301- runs-on : ubuntu-20 .04
290+ runs-on : ubuntu-22 .04
302291 if : ${{ success() && github.event_name == 'push' && github.ref_type == 'tag' }}
303292 steps :
304293 # no need to checkout
@@ -322,7 +311,7 @@ jobs:
322311 # Implement a very basic Python package repository (https://peps.python.org/pep-0503/)
323312 # and deploy the static files to GitHub Pages
324313 needs : [build-and-test, sdist]
325- runs-on : ubuntu-20 .04
314+ runs-on : ubuntu-22 .04
326315 if : ${{ (success() || failure()) && (github.ref_name == 'main' || github.ref_type == 'tag') }} # publish nightly builds regardless of tests failure
327316 permissions : # grant GITHUB_TOKEN the permissions required to make a Pages deployment
328317 pages : write
@@ -382,7 +371,7 @@ jobs:
382371 publish-archive :
383372 # Publish to ⊇istributive's archive server (https://archive.distributed.computer/releases/pythonmonkey/)
384373 needs : [build-and-test, sdist]
385- runs-on : ubuntu-20 .04
374+ runs-on : ubuntu-22 .04
386375 if : ${{ (success() || failure()) && (github.ref_name == 'main' || github.ref_type == 'tag') }}
387376 environment :
388377 name : archive
0 commit comments