25
25
strategy :
26
26
fail-fast : false
27
27
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
30
31
python_version : [ '3.10' ]
31
32
runs-on : ${{ matrix.os }}
32
33
steps :
@@ -40,13 +41,13 @@ jobs:
40
41
with :
41
42
path : |
42
43
./_spidermonkey_install/*
43
- key : spidermonkey102.13 -${{ runner.os }}-${{ runner.arch }}
44
+ key : spidermonkey115.7.0 -${{ runner.os }}-${{ runner.arch }}
44
45
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
50
51
- name : Build spidermonkey
51
52
if : ${{ steps.cache-spidermonkey.outputs.cache-hit != 'true' }}
52
53
run : ./setup.sh
60
61
with :
61
62
path : |
62
63
./_spidermonkey_install/*
63
- key : spidermonkey102.13 -${{ runner.os }}-${{ runner.arch }}
64
+ key : spidermonkey115.7.0 -${{ runner.os }}-${{ runner.arch }}
64
65
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
70
66
- name : Install dependencies
71
67
if : ${{ steps.cache-spidermonkey.outputs.cache-hit != 'true' }}
72
68
shell : powershell
@@ -82,30 +78,35 @@ jobs:
82
78
powershell -command 'Start-Process -Wait -FilePath "./MozillaBuildSetup-Latest.exe" -ArgumentList "/S"'
83
79
- name : Build spidermonkey in MozillaBuild environment
84
80
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
85
85
run : /c/mozilla-build/start-shell.bat -use-full-path -here ./setup.sh
86
86
build-and-test :
87
87
needs : [build-spidermonkey-unix, build-spidermonkey-win]
88
88
strategy :
89
89
fail-fast : false
90
90
matrix :
91
91
# 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' ]
94
94
exclude :
95
95
# macOS 12 comes with Python 3.9 by default, so we drop ci support for Python 3.8 on macOS
96
96
# FIXME: We can't build on macOS 11 for now because our prebuilt `uncrustify` binary requires macOS 12
97
97
- os : ' macos-12'
98
98
python_version : ' 3.8'
99
99
# actions/setup-python: The version '3.8'/'3.9' with architecture 'arm64' was not found for macOS.
100
100
# see https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json
101
- - os : ' m2ci '
101
+ - os : ' macos-14 '
102
102
python_version : ' 3.8'
103
- - os : ' m2ci '
103
+ - os : ' macos-14 '
104
104
python_version : ' 3.9'
105
105
runs-on : ${{ matrix.os }}
106
106
steps :
107
107
- uses : actions/checkout@v3
108
108
with :
109
+ submodules : recursive
109
110
fetch-depth : 0 # fetch all history for all branches and tags
110
111
# poetry-dynamic-versioning needs git tags to produce the correct version number
111
112
- uses : actions/setup-python@v4
@@ -120,7 +121,13 @@ jobs:
120
121
echo "Installing Dependencies"
121
122
if [[ "$OSTYPE" == "linux-gnu"* ]]; then # Linux
122
123
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
124
131
elif [[ "$OSTYPE" == "darwin"* ]]; then # macOS
125
132
brew update || true # allow failure
126
133
brew install cmake doxygen graphviz pkg-config wget coreutils # `coreutils` installs the `realpath` command
@@ -135,7 +142,7 @@ jobs:
135
142
with :
136
143
path : |
137
144
./_spidermonkey_install/*
138
- key : spidermonkey102.13 -${{ runner.os }}-${{ runner.arch }}
145
+ key : spidermonkey115.7.0 -${{ runner.os }}-${{ runner.arch }}
139
146
fail-on-cache-miss : true # SpiderMonkey is expected to be cached in its dedicated job
140
147
- name : Build pminit
141
148
run : |
@@ -154,13 +161,17 @@ jobs:
154
161
with :
155
162
name : wheel-${{ github.run_id }}-${{ github.sha }}
156
163
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/
157
170
- name : Run Python tests (pytest)
158
171
run : |
159
172
poetry run python -m pip install --force-reinstall --verbose ./dist/*
160
173
poetry run python -m pytest tests/python
161
174
- 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
164
175
run : |
165
176
poetry run bash ./peter-jr ./tests/js/
166
177
sdist :
@@ -191,14 +202,11 @@ jobs:
191
202
runs-on : ubuntu-20.04
192
203
if : ${{ success() && github.event_name == 'push' && contains(github.ref, 'refs/tags/') }}
193
204
steps :
194
- - uses : actions/ checkout@v3
205
+ # no need to checkout
195
206
- uses : actions/setup-python@v4
196
207
with :
197
208
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
202
210
- name : Download wheels built
203
211
uses : actions/download-artifact@v3
204
212
with :
@@ -207,8 +215,8 @@ jobs:
207
215
- run : ls -lah ./dist/
208
216
- name : Publish package
209
217
run : |
210
- poetry publish \
211
- --no-interaction --skip-existing \
218
+ twine upload dist/* \
219
+ --non-interactive --skip-existing \
212
220
--username __token__ --password ${{ secrets.PYPI_API_TOKEN }}
213
221
publish-nightly :
214
222
# Implement a very basic Python package repository (https://peps.python.org/pep-0503/)
@@ -229,6 +237,11 @@ jobs:
229
237
with :
230
238
name : wheel-${{ github.run_id }}-${{ github.sha }}
231
239
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/
232
245
- name : Move wheels to the correct repository project paths
233
246
run : |
234
247
mkdir -p ./pythonmonkey/ ./pminit/
0 commit comments