Skip to content

November 2025 PHP updates #561

November 2025 PHP updates

November 2025 PHP updates #561

Workflow file for this run

name: CI
on:
push:
# Avoid duplicate builds on PRs.
branches:
- main
pull_request:
workflow_dispatch:
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
jobs:
lint:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Update Rust toolchain
run: rustup update
- name: Rust Cache
uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1
- name: Clippy
run: cargo clippy --all-targets --locked -- --deny warnings
- name: rustfmt
run: cargo fmt -- --check
unit-test:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Update Rust toolchain
run: rustup update
- name: Rust Cache
uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1
- name: Run unit tests
run: cargo test --locked
integration-test:
strategy:
fail-fast: false
matrix:
builder: ["builder:24", "builder:22"]
arch: ["amd64", "arm64"]
exclude:
- builder: "builder:22"
arch: "arm64"
runs-on: ${{ matrix.arch == 'arm64' && 'ubuntu-24.04-arm' || 'ubuntu-24.04' }}
env:
INTEGRATION_TEST_CNB_BUILDER: heroku/${{ matrix.builder }}
steps:
- name: Checkout
uses: actions/checkout@v5
with:
submodules: true
# The dpkg man-db trigger is excessively slow on GHA runners, see e.g.:
# https://github.com/actions/runner-images/issues/10977
# https://github.com/actions/runner/issues/4030
# We disable it here so it does not fire at the end of the following apt-get install
- name: Disable man-db auto-update
run: sudo rm -f /var/lib/man-db/auto-update
- name: Install musl-tools
run: sudo apt-get install -y --no-install-recommends musl-tools
- name: Update Rust toolchain
run: rustup update
- name: Install Rust linux-musl target
run: rustup target add ${{ matrix.arch == 'arm64' && 'aarch64' || 'x86_64' }}-unknown-linux-musl
- name: Rust Cache
uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1
- name: Install Pack CLI
uses: buildpacks/github-actions/setup-pack@2d58ee348f9a2c381888bfe3dfe99caffdddc84f # v5.9.6
# The images are pulled up front to prevent duplicate pulls due to the tests being run concurrently.
- name: Pull builder image
run: docker pull ${{ env.INTEGRATION_TEST_CNB_BUILDER }}
- name: Pull run image
# Using `docker inspect` rather than `pack builder inspect` since the latter makes
# additional requests to Docker Hub even when the image is available locally.
run: |
RUN_IMAGE=$(
docker inspect --format='{{index .Config.Labels "io.buildpacks.builder.metadata"}}' '${{ env.INTEGRATION_TEST_CNB_BUILDER }}' \
| jq --exit-status --raw-output '.stack.runImage.image'
)
docker pull "${RUN_IMAGE}"
# The integration tests are annotated with the `ignore` attribute, allowing us to run
# only those and not the unit tests, via the `--ignored` option. On the latest stack
# we run all integration tests, but on older stacks we only run stack-specific tests.
- name: Run integration tests (all tests)
run: cargo test --locked -- --ignored --test-threads $(($(nproc)+1))
print-pack-getting-started-output:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v5
# The dpkg man-db trigger is excessively slow on GHA runners, see e.g.:
# https://github.com/actions/runner-images/issues/10977
# https://github.com/actions/runner/issues/4030
# We disable it here so it does not fire at the end of the following apt-get install
- name: Disable man-db auto-update
run: sudo rm -f /var/lib/man-db/auto-update
- name: Install musl-tools
run: sudo apt-get install -y --no-install-recommends musl-tools
- name: Update Rust toolchain
run: rustup update
- name: Install Rust linux-musl target
run: rustup target add x86_64-unknown-linux-musl
- name: Rust Cache
uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1
- name: Install Pack CLI
uses: buildpacks/github-actions/setup-pack@2d58ee348f9a2c381888bfe3dfe99caffdddc84f # v5.9.6
- name: Pull builder and run images
run: |
docker pull "heroku/builder:24"
docker pull "heroku/heroku:24"
- name: Clone getting started guide
uses: actions/checkout@v5
with:
repository: heroku/php-getting-started
path: tmp/guide
- name: Install libcnb-cargo for `cargo libcnb package` command
run: cargo install libcnb-cargo
- name: Compile buildpack
run: cargo libcnb package --target x86_64-unknown-linux-musl
- name: "PRINT: Getting started guide output"
run: pack build my-image --force-color --builder heroku/builder:24 --trust-extra-buildpacks --buildpack packaged/x86_64-unknown-linux-musl/debug/heroku_php --path tmp/guide --pull-policy never
- name: "PRINT: Cached getting started guide output"
run: pack build my-image --force-color --builder heroku/builder:24 --trust-extra-buildpacks --buildpack packaged/x86_64-unknown-linux-musl/debug/heroku_php --path tmp/guide --pull-policy never