71
71
# see https://github.blog/changelog/2024-01-30-github-actions-macos-14-sonoma-is-now-available
72
72
python_version : [ '3.10' ]
73
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
74
+ container : ${{ (startsWith( matrix.os, 'ubuntu') && 'ubuntu:20.04') || null }} # Use the Ubuntu 20.04 container inside Ubuntu 22.04 runner to build
75
75
steps :
76
76
- uses : actions/checkout@v4
77
77
- name : Read the mozilla-central commit hash to be used
@@ -84,14 +84,43 @@ jobs:
84
84
./_spidermonkey_install/*
85
85
key : spidermonkey-${{ env.MOZCENTRAL_VERSION }}-${{ runner.os }}-${{ runner.arch }}
86
86
- name : Setup container
87
- if : ${{ matrix.os == 'ubuntu-22.04' && steps.cache-spidermonkey.outputs.cache-hit != 'true' }}
87
+ if : ${{ startsWith( matrix.os, 'ubuntu') && steps.cache-spidermonkey.outputs.cache-hit != 'true' }}
88
88
run : |
89
89
apt-get update -y
90
90
apt-get install -y sudo libnss3-dev libssl-dev
91
+ apt-get install -y curl make git build-essential
92
+ apt-get install -y zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev # required for pyenv
91
93
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata
92
94
echo "AGENT_TOOLSDIRECTORY=/" >> $GITHUB_ENV # do not use the Python installation cached for Ubuntu 22.04
95
+ - name : Setup LLVM
96
+ if : ${{ startsWith(matrix.os, 'ubuntu') && steps.cache-spidermonkey.outputs.cache-hit != 'true' }}
97
+ run : |
98
+ apt-get install -y llvm clang
99
+ apt-get install -y lsb-release wget software-properties-common gnupg
100
+ wget https://apt.llvm.org/llvm.sh
101
+ chmod +x llvm.sh
102
+ ./llvm.sh 18 # install LLVM version 18
103
+ update-alternatives --install /usr/bin/llvm-config llvm-config /usr/bin/llvm-config-18 18
104
+ update-alternatives --install /usr/bin/clang clang /usr/bin/clang-18 18
105
+ update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-18 18
106
+ clang --version
107
+ clang++ --version
108
+ - name : Setup Python
109
+ if : ${{ startsWith(matrix.os, 'ubuntu') && steps.cache-spidermonkey.outputs.cache-hit != 'true' }}
110
+ run : |
111
+ # Use pyenv to install Python version that is not available via `actions/setup-python`
112
+ unset PYENV_ROOT
113
+ curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
114
+ echo "$HOME/.pyenv/bin" >> $GITHUB_PATH # ~/.bashrc file is not read, so we need to add to GITHUB_PATH manually
115
+ echo "$HOME/.pyenv/shims" >> $GITHUB_PATH
116
+ echo "PYENV_ROOT=$HOME/.pyenv" >> $GITHUB_ENV
117
+ export PATH="$HOME/.pyenv/bin:$PATH"
118
+ pyenv install $PYTHON_VERSION
119
+ pyenv global $PYTHON_VERSION
120
+ env :
121
+ PYTHON_VERSION : ${{ matrix.python_version }}
93
122
- uses : actions/setup-python@v5
94
- if : ${{ steps.cache-spidermonkey.outputs.cache-hit != 'true' }}
123
+ if : ${{ !startsWith(matrix.os, 'ubuntu') && steps.cache-spidermonkey.outputs.cache-hit != 'true' }}
95
124
with :
96
125
python-version : ${{ matrix.python_version }}
97
126
- name : Setup XCode
@@ -154,13 +183,14 @@ jobs:
154
183
os : [ 'ubuntu-22.04', 'macos-13', 'macos-14', 'windows-2022', 'ubuntu-22.04-arm' ]
155
184
python_version : [ '3.8', '3.9', '3.10', '3.11', '3.12', '3.13' ]
156
185
runs-on : ${{ matrix.os }}
157
- container : ${{ (matrix.os == 'ubuntu-22.04' && 'ubuntu:20.04') || null }}
186
+ container : ${{ (startsWith( matrix.os, 'ubuntu') && 'ubuntu:20.04') || null }}
158
187
steps :
159
188
- name : Setup container
160
- if : ${{ matrix.os == 'ubuntu-22.04' }}
189
+ if : ${{ startsWith( matrix.os, 'ubuntu') }}
161
190
run : |
162
191
apt-get update -y
163
192
apt-get install -y sudo libnss3-dev libssl-dev
193
+ apt-get install -y curl zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev # required for pyenv
164
194
apt-get install -y git # required for `actions/checkout`
165
195
apt-get install -y nodejs npm # required for pminit to build
166
196
apt-get install -y build-essential
@@ -179,7 +209,22 @@ jobs:
179
209
submodules : recursive
180
210
fetch-depth : 0 # fetch all history for all branches and tags
181
211
# poetry-dynamic-versioning needs git tags to produce the correct version number
212
+ - name : Setup Python
213
+ if : ${{ startsWith(matrix.os, 'ubuntu') }}
214
+ run : |
215
+ # Use pyenv to install Python version that is not available via `actions/setup-python`
216
+ unset PYENV_ROOT
217
+ curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
218
+ echo "$HOME/.pyenv/bin" >> $GITHUB_PATH # ~/.bashrc file is not read, so we need to add to GITHUB_PATH manually
219
+ echo "$HOME/.pyenv/shims" >> $GITHUB_PATH
220
+ echo "PYENV_ROOT=$HOME/.pyenv" >> $GITHUB_ENV
221
+ export PATH="$HOME/.pyenv/bin:$PATH"
222
+ pyenv install $PYTHON_VERSION
223
+ pyenv global $PYTHON_VERSION
224
+ env :
225
+ PYTHON_VERSION : ${{ matrix.python_version }}
182
226
- uses : actions/setup-python@v5
227
+ if : ${{ !startsWith(matrix.os, 'ubuntu') }}
183
228
with :
184
229
python-version : ${{ matrix.python_version }}
185
230
- name : Setup Poetry
0 commit comments