1717 - ' '
1818 - ' ubuntu-20.04'
1919 - ' macos-12'
20- - ' macos-13'
2120 - ' macos-14'
22- - ' windows-2019 '
21+ - ' windows-2022 '
2322 debug_enabled_python :
2423 type : choice
2524 description : Choose a Python version to run the build with SSH debugging on
@@ -61,42 +60,47 @@ jobs:
6160 fail-fast : false
6261 matrix :
6362 # Use Ubuntu 20.04 / macOS 13 x86_64 / macOS 14 arm64 + Python 3.10 to build SpiderMonkey
64- os : [ 'ubuntu-20.04', 'macos-13', 'macos-14' ] # macOS 14 runner exclusively runs on M1 hardwares
65- # see https://github.blog/changelog/2024-01-30-github-actions-macos-14-sonoma-is-now-available
63+ os : [ 'ubuntu-20.04', 'macos-13', 'macos-14', 'pi' ] # macOS 14 runner exclusively runs on M1 hardwares
64+ # see https://github.blog/changelog/2024-01-30-github-actions-macos-14-sonoma-is-now-available
6665 python_version : [ '3.10' ]
6766 runs-on : ${{ matrix.os }}
6867 steps :
6968 - uses : actions/checkout@v4
7069 - uses : actions/setup-python@v5
7170 with :
7271 python-version : ${{ matrix.python_version }}
72+ - name : Read the mozilla-central commit hash to be used
73+ run : echo "MOZCENTRAL_VERSION=$(cat mozcentral.version)" >> $GITHUB_ENV
7374 - name : Cache spidermonkey build
7475 id : cache-spidermonkey
7576 uses : actions/cache@v4
7677 with :
7778 path : |
7879 ./_spidermonkey_install/*
79- key : spidermonkey115.8.0 -${{ runner.os }}-${{ runner.arch }}
80+ key : spidermonkey-${{ env.MOZCENTRAL_VERSION }} -${{ runner.os }}-${{ runner.arch }}
8081 lookup-only : true # skip download
8182 - name : Setup XCode
8283 if : ${{ (matrix.os == 'macos-13' || matrix.os == 'macos-14') && steps.cache-spidermonkey.outputs.cache-hit != 'true' }}
83- # SpiderMonkey 115 ESR requires XCode SDK version at least 13.3
84- # https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md#installed-sdks
84+ # SpiderMonkey requires XCode SDK version at least 13.3
8585 run : sudo xcode-select -switch /Applications/Xcode_14.3.app
8686 - name : Build spidermonkey
8787 if : ${{ steps.cache-spidermonkey.outputs.cache-hit != 'true' }}
8888 run : ./setup.sh
8989 build-spidermonkey-win :
90- runs-on : windows-2019
90+ runs-on : windows-2022
91+ # SpiderMonkey requires Visual Studio 2022 or newer.
92+ # The Windows 2019 runner only has Visual Studio Enterprise 2019 installed.
9193 steps :
9294 - uses : actions/checkout@v4
95+ - name : Read the mozilla-central commit hash to be used
96+ run : echo "MOZCENTRAL_VERSION=$(cat mozcentral.version)" >> $GITHUB_ENV
9397 - name : Cache spidermonkey build
9498 id : cache-spidermonkey
9599 uses : actions/cache@v4
96100 with :
97101 path : |
98102 ./_spidermonkey_install/*
99- key : spidermonkey115.8.0 -${{ runner.os }}-${{ runner.arch }}
103+ key : spidermonkey-${{ env.MOZCENTRAL_VERSION }} -${{ runner.os }}-${{ runner.arch }}
100104 lookup-only : true # skip download
101105 - name : Install dependencies
102106 if : ${{ steps.cache-spidermonkey.outputs.cache-hit != 'true' }}
@@ -105,7 +109,7 @@ jobs:
105109 # Already installed in Github Actions runner
106110 # choco install -y cmake --installargs 'ADD_CMAKE_TO_PATH=System' # add CMake to system PATH
107111 # choco install -y llvm gnuwin32-m4
108- choco install -y wget make
112+ choco install -y wget make unzip
109113 - name : Install MozillaBuild
110114 if : ${{ steps.cache-spidermonkey.outputs.cache-hit != 'true' }}
111115 run : |
@@ -123,19 +127,8 @@ jobs:
123127 strategy :
124128 fail-fast : false
125129 matrix :
126- # The lowest supported version is Ubuntu 20.04 + Python 3.8 or macOS 12 + Python 3.9
127- os : [ 'ubuntu-20.04', 'macos-12', 'macos-13', 'macos-14', 'windows-2019' ]
130+ os : [ 'ubuntu-20.04', 'macos-12', 'macos-14', 'windows-2022', 'pi' ]
128131 python_version : [ '3.8', '3.9', '3.10', '3.11', '3.12' ]
129- exclude :
130- # macOS 12 comes with Python 3.9 by default, so we drop ci support for Python 3.8 on macOS
131- - os : ' macos-12'
132- python_version : ' 3.8'
133- # actions/setup-python: The version '3.8'/'3.9' with architecture 'arm64' was not found for macOS.
134- # see https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json
135- - os : ' macos-14'
136- python_version : ' 3.8'
137- - os : ' macos-14'
138- python_version : ' 3.9'
139132 runs-on : ${{ matrix.os }}
140133 steps :
141134 - uses : actions/checkout@v4
@@ -146,6 +139,9 @@ jobs:
146139 - uses : actions/setup-python@v5
147140 with :
148141 python-version : ${{ matrix.python_version }}
142+ - name : Remove old poetry cache
143+ run : rm -rf ~/.cache/pypoetry
144+ if : ${{ matrix.os == 'pi' }}
149145 - name : Setup Poetry
150146 uses : snok/install-poetry@v1
151147 with :
@@ -155,22 +151,42 @@ jobs:
155151 echo "Installing Dependencies"
156152 if [[ "$OSTYPE" == "linux-gnu"* ]]; then # Linux
157153 sudo apt-get update -y
158- sudo apt-get install -y cmake graphviz llvm
154+ sudo apt-get install -y cmake llvm
159155 elif [[ "$OSTYPE" == "darwin"* ]]; then # macOS
160156 brew update || true # allow failure
161- brew install cmake pkg-config wget coreutils # `coreutils` installs the `realpath` command
157+ brew install cmake pkg-config wget unzip coreutils # `coreutils` installs the `realpath` command
162158 fi
163159 echo "Installing python deps"
164160 poetry self add "poetry-dynamic-versioning[plugin]"
165- poetry env use python3 # use the correct Python version we've set up
161+ poetry env use python$PYTHON_VERSION || poetry env use python3 # use the correct Python version we've set up
166162 poetry install --no-root --only=dev
167163 echo "Installed Dependencies"
164+ env :
165+ PYTHON_VERSION : ${{ matrix.python_version }}
166+ - name : Build Docs # only build docs once
167+ if : ${{ matrix.os == 'ubuntu-20.04' && matrix.python_version == '3.11' }}
168+ run : |
169+ sudo apt-get install -y graphviz
170+ # the newest version in Ubuntu 20.04 repository is 1.8.17, but we need Doxygen 1.9 series
171+ wget -c -q https://www.doxygen.nl/files/doxygen-1.9.7.linux.bin.tar.gz
172+ tar xf doxygen-1.9.7.linux.bin.tar.gz
173+ cd doxygen-1.9.7 && sudo make install && cd -
174+ rm -rf doxygen-1.9.7 doxygen-1.9.7.linux.bin.tar.gz
175+ BUILD_DOCS=1 BUILD_TYPE=None poetry install
176+ - name : Upload Doxygen-generated docs as CI artifacts
177+ if : ${{ matrix.os == 'ubuntu-20.04' && matrix.python_version == '3.11' }}
178+ uses : actions/upload-artifact@v3
179+ with :
180+ name : docs-${{ github.run_id }}-${{ github.sha }}
181+ path : ./build/docs/html/
182+ - name : Read the mozilla-central commit hash to be used
183+ run : echo "MOZCENTRAL_VERSION=$(cat mozcentral.version)" >> $GITHUB_ENV
168184 - name : Use cached spidermonkey build
169185 uses : actions/cache@v4
170186 with :
171187 path : |
172188 ./_spidermonkey_install/*
173- key : spidermonkey115.8.0 -${{ runner.os }}-${{ runner.arch }}
189+ key : spidermonkey-${{ env.MOZCENTRAL_VERSION }} -${{ runner.os }}-${{ runner.arch }}
174190 fail-on-cache-miss : true # SpiderMonkey is expected to be cached in its dedicated job
175191 - name : Build pminit
176192 run : |
@@ -185,13 +201,24 @@ jobs:
185201 WORKFLOW_BUILD_TYPE=${{ inputs.build_type }}
186202 BUILD_TYPE=${WORKFLOW_BUILD_TYPE:-"Debug"} poetry build --format=wheel
187203 ls -lah ./dist/
204+ - name : Make the wheels we build also support lower versions of macOS
205+ if : ${{ matrix.os == 'macos-12' || matrix.os == 'macos-14' }}
206+ # Change the platform tag part of the wheel filename to `macosx_11_0_xxx` (means to support macOS 11.0 and above)
207+ # See https://packaging.python.org/en/latest/specifications/binary-distribution-format/#file-format
208+ # A wheel package file will only be selected by pip to install if the platform tag satisfies, regardless of whether the binary compatibility actually is.
209+ # Otherwise, pip would fallback to compile from the source distribution.
210+ run : |
211+ cd ./dist/
212+ for file in *.whl; do
213+ mv "$file" "$(echo "$file" | sed -E 's/macosx_[0-9]+_[0-9]+/macosx_11_0/')";
214+ done
188215 - name : Upload wheel as CI artifacts
189216 uses : actions/upload-artifact@v3
190217 with :
191218 name : wheel-${{ github.run_id }}-${{ github.sha }}
192219 path : ./dist/
193220 - name : Set cores to get stored in /cores
194- if : ${{ matrix.os != 'windows-2019 ' }}
221+ if : ${{ matrix.os != 'windows-2022 ' }}
195222 # TODO (Caleb Aikens) figure out how to get Windows core dumps
196223 run : |
197224 sudo mkdir -p /cores
@@ -226,7 +253,7 @@ jobs:
226253 credentials : " admin:admin"
227254 - name : Upload core dumps as CI artifacts
228255 uses : actions/upload-artifact@v3
229- if : ${{ matrix.os != 'windows-2019 ' && failure() }}
256+ if : ${{ matrix.os != 'windows-2022 ' && failure() }}
230257 # TODO (Caleb Aikens) figure out how to get Windows core dumps
231258 with :
232259 name : cores-${{ matrix.os }}-${{ matrix.python_version }}
@@ -246,26 +273,27 @@ jobs:
246273 version : 1.5.1
247274 - name : Build source distribution (sdist) file
248275 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
255276 poetry self add "poetry-dynamic-versioning[plugin]"
256- BUILD_DOCS=1 BUILD_TYPE=None poetry install
257277 poetry build --format=sdist
258278 ls -lah ./dist/
259279 - name : Upload sdist as CI artifacts
260280 uses : actions/upload-artifact@v3
261281 with :
262282 name : wheel-${{ github.run_id }}-${{ github.sha }}
263283 path : ./dist/
264- - name : Upload Doxygen-generated docs as CI artifacts
265- uses : actions/upload-artifact@v3
284+ check-install-from-sdist :
285+ needs : sdist
286+ runs-on : ubuntu-24.04
287+ steps :
288+ - uses : actions/setup-python@v5
266289 with :
267- name : docs-${{ github.run_id }}-${{ github.sha }}
268- path : ./build/docs/html/
290+ python-version : ' 3.10'
291+ - name : Download wheels built
292+ uses : actions/download-artifact@v3
293+ with :
294+ name : wheel-${{ github.run_id }}-${{ github.sha }}
295+ path : ./dist/
296+ - run : pip install ./dist/pythonmonkey-*.tar.gz
269297 publish :
270298 needs : [build-and-test, sdist]
271299 runs-on : ubuntu-20.04
0 commit comments