7171 # see https://github.blog/changelog/2024-01-30-github-actions-macos-14-sonoma-is-now-available
7272 python_version : [ '3.10' ]
7373 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 : ${{ ( runner .os == 'Linux ' && 'ubuntu:20.04') || null }} # Use the Ubuntu 20.04 container inside Ubuntu 22.04 runner to build
7575 steps :
7676 - uses : actions/checkout@v4
7777 - name : Read the mozilla-central commit hash to be used
@@ -84,14 +84,29 @@ jobs:
8484 ./_spidermonkey_install/*
8585 key : spidermonkey-${{ env.MOZCENTRAL_VERSION }}-${{ runner.os }}-${{ runner.arch }}
8686 - name : Setup container
87- if : ${{ matrix .os == 'ubuntu-22.04 ' && steps.cache-spidermonkey.outputs.cache-hit != 'true' }}
87+ if : ${{ runner .os == 'Linux ' && steps.cache-spidermonkey.outputs.cache-hit != 'true' }}
8888 run : |
8989 apt-get update -y
9090 apt-get install -y sudo libnss3-dev libssl-dev
91+ 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
9192 DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata
9293 echo "AGENT_TOOLSDIRECTORY=/" >> $GITHUB_ENV # do not use the Python installation cached for Ubuntu 22.04
94+ - name : Setup Python
95+ if : ${{ runner.os == 'Linux' && steps.cache-spidermonkey.outputs.cache-hit != 'true' }}
96+ run : |
97+ # Use pyenv to install Python version that is not available via `actions/setup-python`
98+ unset PYENV_ROOT
99+ curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
100+ echo "$HOME/.pyenv/bin" >> $GITHUB_PATH # ~/.bashrc file is not read, so we need to add to GITHUB_PATH manually
101+ echo "$HOME/.pyenv/shims" >> $GITHUB_PATH
102+ echo "PYENV_ROOT=$HOME/.pyenv" >> $GITHUB_ENV
103+ export PATH="$HOME/.pyenv/bin:$PATH"
104+ pyenv install $PYTHON_VERSION
105+ pyenv global $PYTHON_VERSION
106+ env :
107+ PYTHON_VERSION : ${{ matrix.python_version }}
93108 - uses : actions/setup-python@v5
94- if : ${{ steps.cache-spidermonkey.outputs.cache-hit != 'true' }}
109+ if : ${{ runner.os != 'Linux' && steps.cache-spidermonkey.outputs.cache-hit != 'true' }}
95110 with :
96111 python-version : ${{ matrix.python_version }}
97112 - name : Setup XCode
@@ -154,10 +169,10 @@ jobs:
154169 os : [ 'ubuntu-22.04', 'macos-13', 'macos-14', 'windows-2022', 'ubuntu-22.04-arm' ]
155170 python_version : [ '3.8', '3.9', '3.10', '3.11', '3.12', '3.13' ]
156171 runs-on : ${{ matrix.os }}
157- container : ${{ (matrix .os == 'ubuntu-22.04 ' && 'ubuntu:20.04') || null }}
172+ container : ${{ (runner .os == 'Linux ' && 'ubuntu:20.04') || null }}
158173 steps :
159174 - name : Setup container
160- if : ${{ matrix .os == 'ubuntu-22.04 ' }}
175+ if : ${{ runner .os == 'Linux ' }}
161176 run : |
162177 apt-get update -y
163178 apt-get install -y sudo libnss3-dev libssl-dev
@@ -198,9 +213,6 @@ jobs:
198213 if : ${{ runner.os != 'Linux' }}
199214 with :
200215 python-version : ${{ matrix.python_version }}
201- - run : |
202- python --version
203- python3 --version
204216 - name : Setup Poetry
205217 uses : snok/install-poetry@v1
206218 with :
0 commit comments