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 : ${{ ( runner .os == 'Linux' && '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
7575 steps :
7676 - uses : actions/checkout@v4
7777 - name : Read the mozilla-central commit hash to be used
@@ -84,15 +84,15 @@ jobs:
8484 ./_spidermonkey_install/*
8585 key : spidermonkey-${{ env.MOZCENTRAL_VERSION }}-${{ runner.os }}-${{ runner.arch }}
8686 - name : Setup container
87- if : ${{ runner .os == 'Linux' && steps.cache-spidermonkey.outputs.cache-hit != 'true' }}
87+ if : ${{ startsWith(matrix .os, 'ubuntu') && steps.cache-spidermonkey.outputs.cache-hit != 'true' }}
8888 run : |
8989 apt-get update -y
9090 apt-get install -y sudo libnss3-dev libssl-dev
9191 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
9292 DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata
9393 echo "AGENT_TOOLSDIRECTORY=/" >> $GITHUB_ENV # do not use the Python installation cached for Ubuntu 22.04
9494 - name : Setup Python
95- if : ${{ runner .os == 'Linux' && steps.cache-spidermonkey.outputs.cache-hit != 'true' }}
95+ if : ${{ startsWith(matrix .os, 'ubuntu') && steps.cache-spidermonkey.outputs.cache-hit != 'true' }}
9696 run : |
9797 # Use pyenv to install Python version that is not available via `actions/setup-python`
9898 unset PYENV_ROOT
@@ -106,7 +106,7 @@ jobs:
106106 env :
107107 PYTHON_VERSION : ${{ matrix.python_version }}
108108 - uses : actions/setup-python@v5
109- if : ${{ runner .os != 'Linux' && steps.cache-spidermonkey.outputs.cache-hit != 'true' }}
109+ if : ${{ !startsWith(matrix .os, 'ubuntu') && steps.cache-spidermonkey.outputs.cache-hit != 'true' }}
110110 with :
111111 python-version : ${{ matrix.python_version }}
112112 - name : Setup XCode
@@ -169,10 +169,10 @@ jobs:
169169 os : [ 'ubuntu-22.04', 'macos-13', 'macos-14', 'windows-2022', 'ubuntu-22.04-arm' ]
170170 python_version : [ '3.8', '3.9', '3.10', '3.11', '3.12', '3.13' ]
171171 runs-on : ${{ matrix.os }}
172- container : ${{ (runner .os == 'Linux' && 'ubuntu:20.04') || null }}
172+ container : ${{ (startsWith(matrix .os, 'ubuntu') && 'ubuntu:20.04') || null }}
173173 steps :
174174 - name : Setup container
175- if : ${{ runner .os == 'Linux' }}
175+ if : ${{ startsWith(matrix .os, 'ubuntu') }}
176176 run : |
177177 apt-get update -y
178178 apt-get install -y sudo libnss3-dev libssl-dev
@@ -196,7 +196,7 @@ jobs:
196196 fetch-depth : 0 # fetch all history for all branches and tags
197197 # poetry-dynamic-versioning needs git tags to produce the correct version number
198198 - name : Setup Python
199- if : ${{ runner .os == 'Linux' }}
199+ if : ${{ startsWith(matrix .os, 'ubuntu') }}
200200 run : |
201201 # Use pyenv to install Python version that is not available via `actions/setup-python`
202202 unset PYENV_ROOT
@@ -210,7 +210,7 @@ jobs:
210210 env :
211211 PYTHON_VERSION : ${{ matrix.python_version }}
212212 - uses : actions/setup-python@v5
213- if : ${{ runner .os != 'Linux' }}
213+ if : ${{ !startsWith(matrix .os, 'ubuntu') }}
214214 with :
215215 python-version : ${{ matrix.python_version }}
216216 - name : Setup Poetry
0 commit comments