2525 strategy :
2626 fail-fast : false
2727 matrix :
28- # Use Ubuntu 20.04 / macOS 12 + Python 3.10 to build SpiderMonkey
29- os : [ 'ubuntu-20.04', 'macos-12', 'm2ci' ]
28+ # Use Ubuntu 20.04 / macOS 13 x86_64 / macOS 14 arm64 + Python 3.10 to build SpiderMonkey
29+ os : [ 'ubuntu-20.04', 'macos-13', 'macos-14' ] # macOS 14 runner exclusively runs on M1 hardwares
30+ # see https://github.blog/changelog/2024-01-30-github-actions-macos-14-sonoma-is-now-available
3031 python_version : [ '3.10' ]
3132 runs-on : ${{ matrix.os }}
3233 steps :
@@ -40,13 +41,13 @@ jobs:
4041 with :
4142 path : |
4243 ./_spidermonkey_install/*
43- key : spidermonkey102.13 -${{ runner.os }}-${{ runner.arch }}
44+ key : spidermonkey115.7.0 -${{ runner.os }}-${{ runner.arch }}
4445 lookup-only : true # skip download
45- - name : Setup Poetry
46- if : ${{ steps.cache-spidermonkey.outputs.cache-hit != 'true' }}
47- uses : snok/install-poetry@v1
48- with :
49- version : 1.5.1
46+ - name : Setup XCode
47+ if : ${{ (matrix.os == 'macos-13' || matrix.os == 'macos-14') && steps.cache-spidermonkey.outputs.cache-hit != 'true' }}
48+ # SpiderMonkey 115 ESR requires XCode SDK version at least 13.3
49+ # https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md#installed-sdks
50+ run : sudo xcode-select -switch /Applications/Xcode_14.3.app
5051 - name : Build spidermonkey
5152 if : ${{ steps.cache-spidermonkey.outputs.cache-hit != 'true' }}
5253 run : ./setup.sh
6061 with :
6162 path : |
6263 ./_spidermonkey_install/*
63- key : spidermonkey102.13 -${{ runner.os }}-${{ runner.arch }}
64+ key : spidermonkey115.7.0 -${{ runner.os }}-${{ runner.arch }}
6465 lookup-only : true # skip download
65- - name : Setup Poetry
66- if : ${{ steps.cache-spidermonkey.outputs.cache-hit != 'true' }}
67- uses : snok/install-poetry@v1
68- with :
69- version : 1.5.1
7066 - name : Install dependencies
7167 if : ${{ steps.cache-spidermonkey.outputs.cache-hit != 'true' }}
7268 shell : powershell
@@ -82,30 +78,35 @@ jobs:
8278 powershell -command 'Start-Process -Wait -FilePath "./MozillaBuildSetup-Latest.exe" -ArgumentList "/S"'
8379 - name : Build spidermonkey in MozillaBuild environment
8480 if : ${{ steps.cache-spidermonkey.outputs.cache-hit != 'true' }}
81+ env :
82+ # Preserve MozillaBuild v4.0.x behaviour
83+ # see https://groups.google.com/u/1/a/mozilla.org/g/dev-platform/c/hF51Q3j6ca8
84+ USE_MINTTY : 0
8585 run : /c/mozilla-build/start-shell.bat -use-full-path -here ./setup.sh
8686 build-and-test :
8787 needs : [build-spidermonkey-unix, build-spidermonkey-win]
8888 strategy :
8989 fail-fast : false
9090 matrix :
9191 # 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', 'm2ci ' ]
93- python_version : [ '3.8', '3.9', '3.10', '3.11', '3.12-dev ' ]
92+ os : [ 'ubuntu-20.04', 'macos-12', 'windows-2019', 'macos-14 ' ]
93+ python_version : [ '3.8', '3.9', '3.10', '3.11', '3.12' ]
9494 exclude :
9595 # macOS 12 comes with Python 3.9 by default, so we drop ci support for Python 3.8 on macOS
9696 # FIXME: We can't build on macOS 11 for now because our prebuilt `uncrustify` binary requires macOS 12
9797 - os : ' macos-12'
9898 python_version : ' 3.8'
9999 # actions/setup-python: The version '3.8'/'3.9' with architecture 'arm64' was not found for macOS.
100100 # see https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json
101- - os : ' m2ci '
101+ - os : ' macos-14 '
102102 python_version : ' 3.8'
103- - os : ' m2ci '
103+ - os : ' macos-14 '
104104 python_version : ' 3.9'
105105 runs-on : ${{ matrix.os }}
106106 steps :
107107 - uses : actions/checkout@v3
108108 with :
109+ submodules : recursive
109110 fetch-depth : 0 # fetch all history for all branches and tags
110111 # poetry-dynamic-versioning needs git tags to produce the correct version number
111112 - uses : actions/setup-python@v4
@@ -120,7 +121,13 @@ jobs:
120121 echo "Installing Dependencies"
121122 if [[ "$OSTYPE" == "linux-gnu"* ]]; then # Linux
122123 sudo apt-get update -y
123- sudo apt-get install -y cmake doxygen graphviz llvm
124+ 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
124131 elif [[ "$OSTYPE" == "darwin"* ]]; then # macOS
125132 brew update || true # allow failure
126133 brew install cmake doxygen graphviz pkg-config wget coreutils # `coreutils` installs the `realpath` command
@@ -135,7 +142,7 @@ jobs:
135142 with :
136143 path : |
137144 ./_spidermonkey_install/*
138- key : spidermonkey102.13 -${{ runner.os }}-${{ runner.arch }}
145+ key : spidermonkey115.7.0 -${{ runner.os }}-${{ runner.arch }}
139146 fail-on-cache-miss : true # SpiderMonkey is expected to be cached in its dedicated job
140147 - name : Build pminit
141148 run : |
@@ -154,13 +161,17 @@ jobs:
154161 with :
155162 name : wheel-${{ github.run_id }}-${{ github.sha }}
156163 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/
157170 - name : Run Python tests (pytest)
158171 run : |
159172 poetry run python -m pip install --force-reinstall --verbose ./dist/*
160173 poetry run python -m pytest tests/python
161174 - name : Run JS tests (peter-jr)
162- if : ${{ runner.os != 'Windows' }} # Python on Windows doesn't have the readline library
163- # FIXME: on macOS we must make sure to use the GNU version of wc and realpath
164175 run : |
165176 poetry run bash ./peter-jr ./tests/js/
166177 sdist :
@@ -191,14 +202,11 @@ jobs:
191202 runs-on : ubuntu-20.04
192203 if : ${{ success() && github.event_name == 'push' && contains(github.ref, 'refs/tags/') }}
193204 steps :
194- - uses : actions/ checkout@v3
205+ # no need to checkout
195206 - uses : actions/setup-python@v4
196207 with :
197208 python-version : ' 3.9'
198- - name : Setup Poetry
199- uses : snok/install-poetry@v1
200- with :
201- version : 1.5.1
209+ - run : pip install twine
202210 - name : Download wheels built
203211 uses : actions/download-artifact@v3
204212 with :
@@ -207,8 +215,8 @@ jobs:
207215 - run : ls -lah ./dist/
208216 - name : Publish package
209217 run : |
210- poetry publish \
211- --no-interaction --skip-existing \
218+ twine upload dist/* \
219+ --non-interactive --skip-existing \
212220 --username __token__ --password ${{ secrets.PYPI_API_TOKEN }}
213221 publish-nightly :
214222 # Implement a very basic Python package repository (https://peps.python.org/pep-0503/)
@@ -229,6 +237,11 @@ jobs:
229237 with :
230238 name : wheel-${{ github.run_id }}-${{ github.sha }}
231239 path : ./dist/
240+ - name : Download docs html generated by Doxygen
241+ uses : actions/download-artifact@v3
242+ with :
243+ name : docs-${{ github.run_id }}-${{ github.sha }}
244+ path : ./docs/
232245 - name : Move wheels to the correct repository project paths
233246 run : |
234247 mkdir -p ./pythonmonkey/ ./pminit/
0 commit comments