|
49 | 49 | # don't upgrade outdated brew packages because the process is too slow
|
50 | 50 | HOMEBREW_NO_INSTALL_UPGRADE: 1
|
51 | 51 | HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
|
| 52 | + # apt-get should run in noninteractive mode |
| 53 | + DEBIAN_FRONTEND: noninteractive |
52 | 54 |
|
53 | 55 | defaults:
|
54 | 56 | run:
|
|
69 | 71 | # see https://github.blog/changelog/2024-01-30-github-actions-macos-14-sonoma-is-now-available
|
70 | 72 | python_version: [ '3.10' ]
|
71 | 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 |
72 | 75 | steps:
|
73 | 76 | - uses: actions/checkout@v4
|
74 |
| - - uses: actions/setup-python@v5 |
75 |
| - with: |
76 |
| - python-version: ${{ matrix.python_version }} |
77 | 77 | - name: Read the mozilla-central commit hash to be used
|
78 | 78 | run: echo "MOZCENTRAL_VERSION=$(cat mozcentral.version)" >> $GITHUB_ENV
|
79 | 79 | - name: Cache spidermonkey build
|
|
84 | 84 | ./_spidermonkey_install/*
|
85 | 85 | key: spidermonkey-${{ env.MOZCENTRAL_VERSION }}-${{ runner.os }}-${{ runner.arch }}
|
86 | 86 | lookup-only: true # skip download
|
| 87 | + - name: Setup container |
| 88 | + if: ${{ matrix.os == 'ubuntu-22.04' && steps.cache-spidermonkey.outputs.cache-hit != 'true' }} |
| 89 | + run: | |
| 90 | + apt-get update -y |
| 91 | + apt-get install -y sudo libnss3-dev libssl-dev |
| 92 | + DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata |
| 93 | + echo "AGENT_TOOLSDIRECTORY=/" >> $GITHUB_ENV # do not use the Python installation cached for Ubuntu 22.04 |
| 94 | + - uses: actions/setup-python@v5 |
| 95 | + if: ${{ steps.cache-spidermonkey.outputs.cache-hit != 'true' }} |
| 96 | + with: |
| 97 | + python-version: ${{ matrix.python_version }} |
87 | 98 | - name: Setup XCode
|
88 | 99 | if: ${{ matrix.os == 'macos-13' && steps.cache-spidermonkey.outputs.cache-hit != 'true' }}
|
89 | 100 | # SpiderMonkey requires XCode SDK version at least 13.3
|
@@ -135,7 +146,25 @@ jobs:
|
135 | 146 | os: [ 'ubuntu-22.04', 'macos-13', 'macos-14', 'windows-2022', 'ubuntu-22.04-arm' ]
|
136 | 147 | python_version: [ '3.8', '3.9', '3.10', '3.11', '3.12', '3.13' ]
|
137 | 148 | runs-on: ${{ matrix.os }}
|
| 149 | + container: ${{ (matrix.os == 'ubuntu-22.04' && 'ubuntu:20.04') || null }} |
138 | 150 | steps:
|
| 151 | + - name: Setup container |
| 152 | + if: ${{ matrix.os == 'ubuntu-22.04' }} |
| 153 | + run: | |
| 154 | + apt-get update -y |
| 155 | + apt-get install -y sudo libnss3-dev libssl-dev |
| 156 | + apt-get install -y git # required for `actions/checkout` |
| 157 | + apt-get install -y build-essential |
| 158 | + apt-get install -y strace # required to run JS tests |
| 159 | + DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata # tzdata may ask for user interaction if not explicitly installed here |
| 160 | + echo "AGENT_TOOLSDIRECTORY=/" >> $GITHUB_ENV # do not use the Python installation cached for Ubuntu 22.04 |
| 161 | + git config --global --add safe.directory '*' # silence "git failed because of dubious ownership" |
| 162 | + |
| 163 | + # CMake 3.25 or higher is required |
| 164 | + apt-get install -y ca-certificates gpg wget |
| 165 | + wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null |
| 166 | + echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ focal main' | sudo tee /etc/apt/sources.list.d/kitware.list >/dev/null |
| 167 | + apt-get update -y && apt-get install -y cmake |
139 | 168 | - uses: actions/checkout@v4
|
140 | 169 | with:
|
141 | 170 | submodules: recursive
|
@@ -219,47 +248,20 @@ jobs:
|
219 | 248 | with:
|
220 | 249 | name: wheel-${{ github.run_id }}-${{ github.sha }}-${{ runner.os }}_${{ runner.arch }}_Python${{ matrix.python_version }}
|
221 | 250 | path: ./dist/
|
222 |
| - - name: Set cores to get stored in /cores |
223 |
| - if: ${{ matrix.os != 'windows-2022' }} |
224 |
| - # TODO (Caleb Aikens) figure out how to get Windows core dumps |
225 |
| - run: | |
226 |
| - sudo mkdir -p /cores |
227 |
| - sudo chmod 777 /cores |
228 |
| - # Core filenames will be of the form osname.pythonversion.executable.pid.timestamp: |
229 |
| - if [[ "$OSTYPE" == "linux-gnu"* ]]; then |
230 |
| - sudo bash -c 'echo "/cores/${OSTYPE}.$(poetry run python --version).%e.%p.%t" > /proc/sys/kernel/core_pattern' |
231 |
| - else |
232 |
| - sudo sysctl kern.corefile="/cores/${OSTYPE}.$(poetry run python --version).%e.%p.%y" |
233 |
| - fi |
234 | 251 | - name: Run Python tests (pytest)
|
235 | 252 | run: |
|
236 |
| - if [[ "$OSTYPE" == "linux-gnu"* || "$OSTYPE" == "darwin"* ]]; then |
237 |
| - # TODO (Caleb Aikens) figure out how to get Windows core dumps |
238 |
| - ulimit -c unlimited |
239 |
| - fi |
240 | 253 | WORKFLOW_BUILD_TYPE=${{ inputs.build_type }}
|
241 | 254 | BUILD_TYPE=${WORKFLOW_BUILD_TYPE:-"Debug"} poetry run python -m pip install --force-reinstall --verbose ./dist/*
|
242 | 255 | poetry run python -m pytest tests/python
|
243 | 256 | - name: Run JS tests (peter-jr)
|
244 | 257 | if: ${{ (success() || failure()) }}
|
245 | 258 | run: |
|
246 |
| - if [[ "$OSTYPE" == "linux-gnu"* || "$OSTYPE" == "darwin"* ]]; then |
247 |
| - # TODO (Caleb Aikens) figure out how to get Windows core dumps |
248 |
| - ulimit -c unlimited |
249 |
| - fi |
250 | 259 | poetry run bash ./peter-jr ./tests/js/
|
251 | 260 | - name: SSH debug session
|
252 | 261 | if: ${{ (success() || failure()) && github.event_name == 'workflow_dispatch' && inputs.debug_enabled_os == matrix.os && inputs.debug_enabled_python == matrix.python_version}}
|
253 | 262 | uses: fawazahmed0/action-debug@main
|
254 | 263 | with:
|
255 | 264 | credentials: "admin:admin"
|
256 |
| - - name: Upload core dumps as CI artifacts |
257 |
| - uses: actions/upload-artifact@v4 |
258 |
| - if: ${{ matrix.os != 'windows-2022' && failure() }} |
259 |
| - # TODO (Caleb Aikens) figure out how to get Windows core dumps |
260 |
| - with: |
261 |
| - name: cores-${{ matrix.os }}-${{ matrix.python_version }} |
262 |
| - path: /cores |
263 | 265 | sdist:
|
264 | 266 | runs-on: ubuntu-22.04
|
265 | 267 | steps:
|
|
0 commit comments