Skip to content

Commit fb5ab30

Browse files
committed
Use Turbo build image
1 parent 1d936b5 commit fb5ab30

1 file changed

Lines changed: 24 additions & 40 deletions

File tree

‎.github/workflows/phar.yml‎

Lines changed: 24 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -298,18 +298,25 @@ jobs:
298298
name: "Compile Turbo Extension"
299299
runs-on: ${{ matrix.target.runs-on }}
300300
# Container legs pin the built binaries' userland floor independently of
301-
# the runner image: ubuntu:22.04 keeps the glibc symbol floor at 2.34
302-
# (RHEL 9, Ubuntu 22.04+, Debian 12+), alpine:3.24 builds the musl
303-
# variant. The linux-musl-arm64 leg lives in the separate
304-
# turbo-compile-musl-arm64 job below: JavaScript-based actions cannot run
305-
# in Alpine containers on arm64 runners (the runner only ships an x64
306-
# musl Node), so that job drives the Alpine container through docker exec
307-
# instead of a `container:` leg. The ZTS legs (for hosts with a
308-
# thread-safe PHP, like PMMP's bundled build) run directly on
309-
# ubuntu-22.04 runners — same glibc floor — because no distro packages
310-
# ZTS PHP (neither ppa:ondrej/php nor Alpine); setup-php provides
311-
# thread-safe builds. No musl ZTS for the same packaging reason.
312-
container: ${{ matrix.target.container }}
301+
# the runner image. The gnu legs run in a prebuilt ubuntu:22.04-based
302+
# image (.github/turbo-build/Dockerfile, published to GHCR by
303+
# turbo-build-image.yml) with the PHP toolchain baked in: the glibc
304+
# symbol floor stays at 2.34 (RHEL 9, Ubuntu 22.04+, Debian 12+) and the
305+
# jobs run no apt at all — ports.ubuntu.com (the only Ubuntu arm64
306+
# mirror) has repeated outages that failed the arm64 legs, and the
307+
# from-scratch PPA setup cost ~1 minute on every x86_64 leg. alpine:3.24
308+
# builds the musl variant; apk installs take seconds from a CDN, so no
309+
# prebuilt image is needed there. The linux-musl-arm64 leg lives in the
310+
# separate turbo-compile-musl-arm64 job below: JavaScript-based actions
311+
# cannot run in Alpine containers on arm64 runners (the runner only
312+
# ships an x64 musl Node), so that job drives the Alpine container
313+
# through docker exec instead of a `container:` leg. The ZTS legs (for
314+
# hosts with a thread-safe PHP, like PMMP's bundled build) run directly
315+
# on ubuntu-22.04 runners — same glibc floor — because no distro
316+
# packages ZTS PHP (neither ppa:ondrej/php nor Alpine); setup-php
317+
# provides thread-safe builds. No musl ZTS for the same packaging
318+
# reason.
319+
container: ${{ matrix.target.family == 'gnu' && format('ghcr.io/phpstan/turbo-build:gnu-php{0}', matrix.php-version) || matrix.target.container }}
313320
timeout-minutes: 30
314321

315322
env:
@@ -322,12 +329,10 @@ jobs:
322329
target:
323330
- name: "linux-gnu-x86_64"
324331
runs-on: "ubuntu-latest"
325-
container: "ubuntu:22.04"
326332
family: "gnu"
327333
artifact: "phpstan_turbo"
328334
- name: "linux-gnu-arm64"
329335
runs-on: "ubuntu-24.04-arm"
330-
container: "ubuntu:22.04"
331336
family: "gnu"
332337
artifact: "phpstan_turbo"
333338
- name: "linux-musl-x86_64"
@@ -365,32 +370,11 @@ jobs:
365370
with:
366371
egress-policy: audit
367372

368-
# Container legs install PHP and tooling before checkout: actions/checkout
369-
# needs git inside the container, and the build needs php/php-config
370-
# symlinks pointing at the matrix PHP version.
371-
- name: "Install PHP and build tools (Ubuntu container)"
372-
if: matrix.target.family == 'gnu'
373-
# apt mirrors 404 mid-sync (the fetched index can reference a
374-
# superseded .deb already pruned from the pool); only a fresh index
375-
# fixes that, so update+install retries as a unit
376-
run: |
377-
export DEBIAN_FRONTEND=noninteractive
378-
apt_install() {
379-
for attempt in 1 2 3; do
380-
if apt-get update && apt-get install -y "$@"; then
381-
return 0
382-
fi
383-
echo "apt-get failed (attempt $attempt), retrying with a fresh index"
384-
sleep 15
385-
done
386-
return 1
387-
}
388-
apt_install software-properties-common gnupg ca-certificates curl git make g++ patch unzip zstd
389-
add-apt-repository -y ppa:ondrej/php
390-
apt_install "php$PHP_MINOR-cli" "php$PHP_MINOR-dev" "php$PHP_MINOR-curl" "php$PHP_MINOR-mbstring" "php$PHP_MINOR-xml"
391-
ln -sf "/usr/bin/php$PHP_MINOR" /usr/local/bin/php
392-
ln -sf "/usr/bin/php-config$PHP_MINOR" /usr/local/bin/php-config
393-
373+
# The Alpine leg installs PHP and tooling before checkout:
374+
# actions/checkout needs git inside the container, and the build needs
375+
# php/php-config symlinks pointing at the matrix PHP version. The gnu
376+
# legs need no install step — their prebuilt turbo-build image bakes
377+
# all of this in.
394378
- name: "Install PHP and build tools (Alpine container)"
395379
if: matrix.target.family == 'musl'
396380
run: |

0 commit comments

Comments
 (0)