Skip to content

DEBUG less CI

DEBUG less CI #787

Workflow file for this run

name: CI
on:
pull_request:
push:
schedule:
- cron: '20 2 1,15 * *'
jobs:
unit:
name: Templating
runs-on: ubuntu-latest
container:
image: ghcr.io/mvorisek/image-php
steps:
- name: Checkout
uses: actions/checkout@v4
- name: "Check if files are in-sync"
run: |
rm -r data/
php make.php
git add . -N && git diff --exit-code
build:
name: Build
runs-on: ubuntu-latest
env:
REGISTRY_NAME: ghcr.io
REGISTRY_IMAGE_NAME: ghcr.io/${{ github.repository }}
strategy:
fail-fast: false
matrix:
imageName:
- "8.3-alpine"
- "8.3-zts-alpine"
- "8.3-debug-alpine"
- "8.4-alpine"
- "8.4-zts-alpine"
- "8.4-debug-alpine"
- "8.5-alpine"
- "8.5-zts-alpine"
- "8.5-debug-alpine"
- "8.3-debian"
- "8.3-zts-debian"
- "8.3-debug-debian"
- "8.4-debian"
- "8.4-zts-debian"
- "8.4-debug-debian"
- "8.5-debian"
- "8.5-zts-debian"
- "8.5-debug-debian"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: 'Build base image - clone & patch - 8.3.x'
if: (matrix.imageName == '8.3-alpine' || matrix.imageName == '8.3-zts-alpine' || matrix.imageName == '8.3-debug-alpine' || matrix.imageName == '8.3-debian' || matrix.imageName == '8.3-zts-debian' || matrix.imageName == '8.3-debug-debian')
run: >-
if [ "${{ matrix.imageName }}" == "8.3-alpine" ] || [ "${{ matrix.imageName }}" == "8.3-zts-alpine" ] || [ "${{ matrix.imageName }}" == "8.3-debug-alpine" ] || [ "${{ matrix.imageName }}" == "8.3-debian" ] || [ "${{ matrix.imageName }}" == "8.3-zts-debian" ] || [ "${{ matrix.imageName }}" == "8.3-debug-debian" ]; then
export PHPSRC_BRANCH="$(git ls-remote 'https://github.com/php/php-src.git' | grep -iE '\srefs/tags/PHP-8\.3\.[0-9]+$' | sort -k2 -V | tee /dev/stderr | awk 'END{print $NF}' | sed -E 's~^refs/[^/]+/~~')"
; fi
&& if [ "${{ matrix.imageName }}" == "8.3-alpine" ] || [ "${{ matrix.imageName }}" == "8.3-zts-alpine" ] || [ "${{ matrix.imageName }}" == "8.3-debug-alpine" ] || [ "${{ matrix.imageName }}" == "8.3-debian" ] || [ "${{ matrix.imageName }}" == "8.3-zts-debian" ] || [ "${{ matrix.imageName }}" == "8.3-debug-debian" ]; then
git clone --depth 1 'https://github.com/php/php-src.git' -b "$PHPSRC_BRANCH" phpsrc
; fi
&& cd phpsrc && export PHPSRC_COMMIT="$(git rev-parse HEAD)"
&& git checkout -B master
&& if [ "${{ matrix.imageName }}" == "8.3-alpine" ] || [ "${{ matrix.imageName }}" == "8.3-zts-alpine" ] || [ "${{ matrix.imageName }}" == "8.3-debug-alpine" ]; then
sed -E 's~#if HAVE_OCILOBREAD2$~#if 1~' -i ext/pdo_oci/oci_statement.c && git -c user.name="a" -c user.email="a@a" commit -am "Fix pdo_oci ext NCLOB read for Alpine - https://github.com/php/php-src/issues/8197"
; fi
&& sudo apt-get -y update && sudo apt-get -y install bison re2c
&& scripts/dev/makedist > /dev/null && mv php-master-*.tar.xz php.tar.xz
&& git add . -N && git diff --diff-filter=d "$PHPSRC_COMMIT"
&& cd ..
&& git clone https://github.com/docker-library/php.git dlphp && cd dlphp
&& true
&& rm -r [0-9].[0-9]*/ && sed -E 's~( // )error\("missing GPG keys for " \+ env\.version\)~\1["x"]~' -i Dockerfile-linux.template
&& if [ "${{ matrix.imageName }}" == "8.3-alpine" ] || [ "${{ matrix.imageName }}" == "8.3-debug-alpine" ]; then
echo '{ "8.3": { "url": "x", "variants": [ "alpine3.19/cli" ], "version": "8.3.99" } }' > versions.json
; elif [ "${{ matrix.imageName }}" == "8.3-zts-alpine" ]; then
echo '{ "8.3": { "url": "x", "variants": [ "alpine3.19/zts" ], "version": "8.3.99" } }' > versions.json
; elif [ "${{ matrix.imageName }}" == "8.3-debian" ] || [ "${{ matrix.imageName }}" == "8.3-debug-debian" ]; then
echo '{ "8.3": { "url": "x", "variants": [ "bookworm/cli" ], "version": "8.3.99" } }' > versions.json
; elif [ "${{ matrix.imageName }}" == "8.3-zts-debian" ]; then
echo '{ "8.3": { "url": "x", "variants": [ "bookworm/zts" ], "version": "8.3.99" } }' > versions.json
; fi
&& true
&& if [ "${{ matrix.imageName }}" == "8.3-alpine" ] || [ "${{ matrix.imageName }}" == "8.3-zts-alpine" ] || [ "${{ matrix.imageName }}" == "8.3-debian" ] || [ "${{ matrix.imageName }}" == "8.3-zts-debian" ]; then
./apply-templates.sh
; elif [ "${{ matrix.imageName }}" == "8.3-debug-alpine" ] || [ "${{ matrix.imageName }}" == "8.3-debug-debian" ]; then
DOCKER_PHP_ENABLE_DEBUG=1 ./apply-templates.sh
; fi
&& if [ "${{ matrix.imageName }}" == "8.3-alpine" ] || [ "${{ matrix.imageName }}" == "8.3-debug-alpine" ]; then
mv 8.3/alpine3.19/cli/ img
; elif [ "${{ matrix.imageName }}" == "8.3-zts-alpine" ]; then
mv 8.3/alpine3.19/zts/ img
; elif [ "${{ matrix.imageName }}" == "8.3-debian" ] || [ "${{ matrix.imageName }}" == "8.3-debug-debian" ]; then
mv 8.3/bookworm/cli/ img
; elif [ "${{ matrix.imageName }}" == "8.3-zts-debian" ]; then
mv 8.3/bookworm/zts/ img
; fi
&& cd img && mv ../../phpsrc/php.tar.xz .
&& sed -E 's~^(ENV PHP_VERSION[ =]).*~\1CUSTOM--'"$PHPSRC_BRANCH--$PHPSRC_COMMIT"'~' -i Dockerfile
&& sed -E 's~^(ENV PHP_URL[ =]).*~COPY php.tar.xz /usr/src/~' -i Dockerfile
&& sed -E 's~^(ENV (GPG_KEYS|PHP_URL|PHP_ASC_URL|PHP_SHA256)[ =]).*~~' -i Dockerfile
&& sed -E 's~-n "\$(PHP_SHA256|PHP_ASC_URL)"~-n ""~' -i Dockerfile
&& sed -E 's~curl -fsSL -o php.tar.xz .*; ~~' -i Dockerfile
&& if [ "${{ matrix.imageName }}" == "8.3-alpine" ] || [ "${{ matrix.imageName }}" == "8.3-zts-alpine" ] || [ "${{ matrix.imageName }}" == "8.3-debug-alpine" ]; then
sed -E 's~(--with-curl.*)( \\)~\1 --enable-embed\2~' -i Dockerfile
; fi
&& true
&& git add . -N && git diff --diff-filter=d
- name: 'Build base image - clone & patch - 8.4.x'
if: (matrix.imageName == '8.4-alpine' || matrix.imageName == '8.4-zts-alpine' || matrix.imageName == '8.4-debug-alpine' || matrix.imageName == '8.4-debian' || matrix.imageName == '8.4-zts-debian' || matrix.imageName == '8.4-debug-debian')
run: >-
if [ "${{ matrix.imageName }}" == "8.4-alpine" ] || [ "${{ matrix.imageName }}" == "8.4-zts-alpine" ] || [ "${{ matrix.imageName }}" == "8.4-debug-alpine" ] || [ "${{ matrix.imageName }}" == "8.4-debian" ] || [ "${{ matrix.imageName }}" == "8.4-zts-debian" ] || [ "${{ matrix.imageName }}" == "8.4-debug-debian" ]; then
export PHPSRC_BRANCH="$(git ls-remote 'https://github.com/php/php-src.git' | grep -iE '\srefs/tags/PHP-8\.4\.[0-9]+(RC[0-9]+)?$' | sort -k2 -V | tee /dev/stderr | awk 'END{print $NF}' | sed -E 's~^refs/[^/]+/~~')"
; fi
&& if [ "${{ matrix.imageName }}" == "8.4-alpine" ] || [ "${{ matrix.imageName }}" == "8.4-zts-alpine" ] || [ "${{ matrix.imageName }}" == "8.4-debug-alpine" ] || [ "${{ matrix.imageName }}" == "8.4-debian" ] || [ "${{ matrix.imageName }}" == "8.4-zts-debian" ] || [ "${{ matrix.imageName }}" == "8.4-debug-debian" ]; then
git clone --depth 1 'https://github.com/php/php-src.git' -b "$PHPSRC_BRANCH" phpsrc
; fi
&& cd phpsrc && export PHPSRC_COMMIT="$(git rev-parse HEAD)"
&& git checkout -B master
&& true
&& sudo apt-get -y update && sudo apt-get -y install bison re2c
&& scripts/dev/makedist > /dev/null && mv php-master-*.tar.xz php.tar.xz
&& git add . -N && git diff --diff-filter=d "$PHPSRC_COMMIT"
&& cd ..
&& git clone https://github.com/docker-library/php.git dlphp && cd dlphp
&& true
&& rm -r [0-9].[0-9]*/ && sed -E 's~( // )error\("missing GPG keys for " \+ env\.version\)~\1["x"]~' -i Dockerfile-linux.template
&& if [ "${{ matrix.imageName }}" == "8.4-alpine" ] || [ "${{ matrix.imageName }}" == "8.4-debug-alpine" ]; then
echo '{ "8.4-rc": { "url": "x", "variants": [ "alpine3.19/cli" ], "version": "8.4.0RC99" } }' > versions.json
; elif [ "${{ matrix.imageName }}" == "8.4-zts-alpine" ]; then
echo '{ "8.4-rc": { "url": "x", "variants": [ "alpine3.19/zts" ], "version": "8.4.0RC99" } }' > versions.json
; elif [ "${{ matrix.imageName }}" == "8.4-debian" ] || [ "${{ matrix.imageName }}" == "8.4-debug-debian" ]; then
echo '{ "8.4-rc": { "url": "x", "variants": [ "bookworm/cli" ], "version": "8.4.0RC99" } }' > versions.json
; elif [ "${{ matrix.imageName }}" == "8.4-zts-debian" ]; then
echo '{ "8.4-rc": { "url": "x", "variants": [ "bookworm/zts" ], "version": "8.4.0RC99" } }' > versions.json
; fi
&& true
&& if [ "${{ matrix.imageName }}" == "8.4-alpine" ] || [ "${{ matrix.imageName }}" == "8.4-zts-alpine" ] || [ "${{ matrix.imageName }}" == "8.4-debian" ] || [ "${{ matrix.imageName }}" == "8.4-zts-debian" ]; then
./apply-templates.sh
; elif [ "${{ matrix.imageName }}" == "8.4-debug-alpine" ] || [ "${{ matrix.imageName }}" == "8.4-debug-debian" ]; then
DOCKER_PHP_ENABLE_DEBUG=1 ./apply-templates.sh
; fi
&& if [ "${{ matrix.imageName }}" == "8.4-alpine" ] || [ "${{ matrix.imageName }}" == "8.4-debug-alpine" ]; then
mv 8.4-rc/alpine3.19/cli/ img
; elif [ "${{ matrix.imageName }}" == "8.4-zts-alpine" ]; then
mv 8.4-rc/alpine3.19/zts/ img
; elif [ "${{ matrix.imageName }}" == "8.4-debian" ] || [ "${{ matrix.imageName }}" == "8.4-debug-debian" ]; then
mv 8.4-rc/bookworm/cli/ img
; elif [ "${{ matrix.imageName }}" == "8.4-zts-debian" ]; then
mv 8.4-rc/bookworm/zts/ img
; fi
&& cd img && mv ../../phpsrc/php.tar.xz .
&& sed -E 's~^(ENV PHP_VERSION[ =]).*~\1CUSTOM--'"$PHPSRC_BRANCH--$PHPSRC_COMMIT"'~' -i Dockerfile
&& sed -E 's~^(ENV PHP_URL[ =]).*~COPY php.tar.xz /usr/src/~' -i Dockerfile
&& sed -E 's~^(ENV (GPG_KEYS|PHP_URL|PHP_ASC_URL|PHP_SHA256)[ =]).*~~' -i Dockerfile
&& sed -E 's~-n "\$(PHP_SHA256|PHP_ASC_URL)"~-n ""~' -i Dockerfile
&& sed -E 's~curl -fsSL -o php.tar.xz .*; ~~' -i Dockerfile
&& if [ "${{ matrix.imageName }}" == "8.4-alpine" ] || [ "${{ matrix.imageName }}" == "8.4-zts-alpine" ] || [ "${{ matrix.imageName }}" == "8.4-debug-alpine" ]; then
sed -E 's~(--with-curl.*)( \\)~\1 --enable-embed\2~' -i Dockerfile
; fi
&& true
&& git add . -N && git diff --diff-filter=d
- name: 'Build base image - clone & patch - 8.5.x'
if: (matrix.imageName == '8.5-alpine' || matrix.imageName == '8.5-zts-alpine' || matrix.imageName == '8.5-debug-alpine' || matrix.imageName == '8.5-debian' || matrix.imageName == '8.5-zts-debian' || matrix.imageName == '8.5-debug-debian')
run: >-
if [ "${{ matrix.imageName }}" == "8.5-alpine" ] || [ "${{ matrix.imageName }}" == "8.5-zts-alpine" ] || [ "${{ matrix.imageName }}" == "8.5-debug-alpine" ] || [ "${{ matrix.imageName }}" == "8.5-debian" ] || [ "${{ matrix.imageName }}" == "8.5-zts-debian" ] || [ "${{ matrix.imageName }}" == "8.5-debug-debian" ]; then
export PHPSRC_BRANCH="$(git ls-remote 'https://github.com/php/php-src.git' | grep -iE '\srefs/heads/master$' | sort -k2 -V | tee /dev/stderr | awk 'END{print $NF}' | sed -E 's~^refs/[^/]+/~~')"
; fi
&& if [ "${{ matrix.imageName }}" == "8.5-alpine" ] || [ "${{ matrix.imageName }}" == "8.5-zts-alpine" ] || [ "${{ matrix.imageName }}" == "8.5-debug-alpine" ] || [ "${{ matrix.imageName }}" == "8.5-debian" ] || [ "${{ matrix.imageName }}" == "8.5-zts-debian" ] || [ "${{ matrix.imageName }}" == "8.5-debug-debian" ]; then
git clone --depth 1 'https://github.com/php/php-src.git' -b "$PHPSRC_BRANCH" phpsrc
; fi
&& cd phpsrc && export PHPSRC_COMMIT="$(git rev-parse HEAD)"
&& git checkout -B master
&& true
&& sudo apt-get -y update && sudo apt-get -y install bison re2c
&& scripts/dev/makedist > /dev/null && mv php-master-*.tar.xz php.tar.xz
&& git add . -N && git diff --diff-filter=d "$PHPSRC_COMMIT"
&& cd ..
&& git clone https://github.com/docker-library/php.git dlphp && cd dlphp
&& true
&& rm -r [0-9].[0-9]*/ && sed -E 's~( // )error\("missing GPG keys for " \+ env\.version\)~\1["x"]~' -i Dockerfile-linux.template
&& if [ "${{ matrix.imageName }}" == "8.5-alpine" ] || [ "${{ matrix.imageName }}" == "8.5-debug-alpine" ]; then
echo '{ "8.4-rc": { "url": "x", "variants": [ "alpine3.19/cli" ], "version": "8.4.0RC99" } }' > versions.json
; elif [ "${{ matrix.imageName }}" == "8.5-zts-alpine" ]; then
echo '{ "8.4-rc": { "url": "x", "variants": [ "alpine3.19/zts" ], "version": "8.4.0RC99" } }' > versions.json
; elif [ "${{ matrix.imageName }}" == "8.5-debian" ] || [ "${{ matrix.imageName }}" == "8.5-debug-debian" ]; then
echo '{ "8.4-rc": { "url": "x", "variants": [ "bookworm/cli" ], "version": "8.4.0RC99" } }' > versions.json
; elif [ "${{ matrix.imageName }}" == "8.5-zts-debian" ]; then
echo '{ "8.4-rc": { "url": "x", "variants": [ "bookworm/zts" ], "version": "8.4.0RC99" } }' > versions.json
; fi
&& true
&& if [ "${{ matrix.imageName }}" == "8.5-alpine" ] || [ "${{ matrix.imageName }}" == "8.5-zts-alpine" ] || [ "${{ matrix.imageName }}" == "8.5-debian" ] || [ "${{ matrix.imageName }}" == "8.5-zts-debian" ]; then
./apply-templates.sh
; elif [ "${{ matrix.imageName }}" == "8.5-debug-alpine" ] || [ "${{ matrix.imageName }}" == "8.5-debug-debian" ]; then
DOCKER_PHP_ENABLE_DEBUG=1 ./apply-templates.sh
; fi
&& if [ "${{ matrix.imageName }}" == "8.5-alpine" ] || [ "${{ matrix.imageName }}" == "8.5-debug-alpine" ]; then
mv 8.4-rc/alpine3.19/cli/ img
; elif [ "${{ matrix.imageName }}" == "8.5-zts-alpine" ]; then
mv 8.4-rc/alpine3.19/zts/ img
; elif [ "${{ matrix.imageName }}" == "8.5-debian" ] || [ "${{ matrix.imageName }}" == "8.5-debug-debian" ]; then
mv 8.4-rc/bookworm/cli/ img
; elif [ "${{ matrix.imageName }}" == "8.5-zts-debian" ]; then
mv 8.4-rc/bookworm/zts/ img
; fi
&& cd img && mv ../../phpsrc/php.tar.xz .
&& sed -E 's~^(ENV PHP_VERSION[ =]).*~\1CUSTOM--'"$PHPSRC_BRANCH--$PHPSRC_COMMIT"'~' -i Dockerfile
&& sed -E 's~^(ENV PHP_URL[ =]).*~COPY php.tar.xz /usr/src/~' -i Dockerfile
&& sed -E 's~^(ENV (GPG_KEYS|PHP_URL|PHP_ASC_URL|PHP_SHA256)[ =]).*~~' -i Dockerfile
&& sed -E 's~-n "\$(PHP_SHA256|PHP_ASC_URL)"~-n ""~' -i Dockerfile
&& sed -E 's~curl -fsSL -o php.tar.xz .*; ~~' -i Dockerfile
&& if [ "${{ matrix.imageName }}" == "8.5-alpine" ] || [ "${{ matrix.imageName }}" == "8.5-zts-alpine" ] || [ "${{ matrix.imageName }}" == "8.5-debug-alpine" ]; then
sed -E 's~(--with-curl.*)( \\)~\1 --enable-embed\2~' -i Dockerfile
; fi
&& true
&& git add . -N && git diff --diff-filter=d
- name: 'Build base image - build - 8.3.x'
if: (matrix.imageName == '8.3-alpine' || matrix.imageName == '8.3-zts-alpine' || matrix.imageName == '8.3-debug-alpine' || matrix.imageName == '8.3-debian' || matrix.imageName == '8.3-zts-debian' || matrix.imageName == '8.3-debug-debian')
# try to build twice to suppress random network issues with Github Actions
run: >-
cd dlphp/img
&& if [ "${{ matrix.imageName }}" == "8.3-alpine" ]; then
((docker pull "php:8.3-cli-alpine3.19" || docker pull "php:8.3-cli-alpine3.19") || true)
&& ((docker pull "$REGISTRY_IMAGE_NAME:8.3-alpine-base" || docker pull "$REGISTRY_IMAGE_NAME:8.3-alpine-base") || true)
&& (docker build --cache-from "php:8.3-cli-alpine3.19" --cache-from "$REGISTRY_IMAGE_NAME:8.3-alpine-base" -t "ci-target:base" ./
|| docker build --cache-from "php:8.3-cli-alpine3.19" --cache-from "$REGISTRY_IMAGE_NAME:8.3-alpine-base" -t "ci-target:base" ./)
; elif [ "${{ matrix.imageName }}" == "8.3-zts-alpine" ]; then
((docker pull "php:8.3-zts-alpine3.19" || docker pull "php:8.3-zts-alpine3.19") || true)
&& ((docker pull "$REGISTRY_IMAGE_NAME:8.3-zts-alpine-base" || docker pull "$REGISTRY_IMAGE_NAME:8.3-zts-alpine-base") || true)
&& (docker build --cache-from "php:8.3-zts-alpine3.19" --cache-from "$REGISTRY_IMAGE_NAME:8.3-zts-alpine-base" -t "ci-target:base" ./
|| docker build --cache-from "php:8.3-zts-alpine3.19" --cache-from "$REGISTRY_IMAGE_NAME:8.3-zts-alpine-base" -t "ci-target:base" ./)
; elif [ "${{ matrix.imageName }}" == "8.3-debug-alpine" ]; then
((docker pull "php:8.3-cli-alpine3.19" || docker pull "php:8.3-cli-alpine3.19") || true)
&& ((docker pull "$REGISTRY_IMAGE_NAME:8.3-debug-alpine-base" || docker pull "$REGISTRY_IMAGE_NAME:8.3-debug-alpine-base") || true)
&& (docker build --cache-from "php:8.3-cli-alpine3.19" --cache-from "$REGISTRY_IMAGE_NAME:8.3-debug-alpine-base" -t "ci-target:base" ./
|| docker build --cache-from "php:8.3-cli-alpine3.19" --cache-from "$REGISTRY_IMAGE_NAME:8.3-debug-alpine-base" -t "ci-target:base" ./)
; elif [ "${{ matrix.imageName }}" == "8.3-debian" ]; then
((docker pull "php:8.3-cli-bookworm" || docker pull "php:8.3-cli-bookworm") || true)
&& ((docker pull "$REGISTRY_IMAGE_NAME:8.3-debian-base" || docker pull "$REGISTRY_IMAGE_NAME:8.3-debian-base") || true)
&& (docker build --cache-from "php:8.3-cli-bookworm" --cache-from "$REGISTRY_IMAGE_NAME:8.3-debian-base" -t "ci-target:base" ./
|| docker build --cache-from "php:8.3-cli-bookworm" --cache-from "$REGISTRY_IMAGE_NAME:8.3-debian-base" -t "ci-target:base" ./)
; elif [ "${{ matrix.imageName }}" == "8.3-zts-debian" ]; then
((docker pull "php:8.3-zts-bookworm" || docker pull "php:8.3-zts-bookworm") || true)
&& ((docker pull "$REGISTRY_IMAGE_NAME:8.3-zts-debian-base" || docker pull "$REGISTRY_IMAGE_NAME:8.3-zts-debian-base") || true)
&& (docker build --cache-from "php:8.3-zts-bookworm" --cache-from "$REGISTRY_IMAGE_NAME:8.3-zts-debian-base" -t "ci-target:base" ./
|| docker build --cache-from "php:8.3-zts-bookworm" --cache-from "$REGISTRY_IMAGE_NAME:8.3-zts-debian-base" -t "ci-target:base" ./)
; elif [ "${{ matrix.imageName }}" == "8.3-debug-debian" ]; then
((docker pull "php:8.3-cli-bookworm" || docker pull "php:8.3-cli-bookworm") || true)
&& ((docker pull "$REGISTRY_IMAGE_NAME:8.3-debug-debian-base" || docker pull "$REGISTRY_IMAGE_NAME:8.3-debug-debian-base") || true)
&& (docker build --cache-from "php:8.3-cli-bookworm" --cache-from "$REGISTRY_IMAGE_NAME:8.3-debug-debian-base" -t "ci-target:base" ./
|| docker build --cache-from "php:8.3-cli-bookworm" --cache-from "$REGISTRY_IMAGE_NAME:8.3-debug-debian-base" -t "ci-target:base" ./)
; fi
- name: 'Build base image - build - 8.4.x'
if: (matrix.imageName == '8.4-alpine' || matrix.imageName == '8.4-zts-alpine' || matrix.imageName == '8.4-debug-alpine' || matrix.imageName == '8.4-debian' || matrix.imageName == '8.4-zts-debian' || matrix.imageName == '8.4-debug-debian')
# try to build twice to suppress random network issues with Github Actions
run: >-
cd dlphp/img
&& if [ "${{ matrix.imageName }}" == "8.4-alpine" ]; then
((docker pull "php:8.4-rc-cli-alpine3.19" || docker pull "php:8.4-rc-cli-alpine3.19") || true)
&& ((docker pull "$REGISTRY_IMAGE_NAME:8.4-alpine-base" || docker pull "$REGISTRY_IMAGE_NAME:8.4-alpine-base") || true)
&& (docker build --cache-from "php:8.4-rc-cli-alpine3.19" --cache-from "$REGISTRY_IMAGE_NAME:8.4-alpine-base" -t "ci-target:base" ./
|| docker build --cache-from "php:8.4-rc-cli-alpine3.19" --cache-from "$REGISTRY_IMAGE_NAME:8.4-alpine-base" -t "ci-target:base" ./)
; elif [ "${{ matrix.imageName }}" == "8.4-zts-alpine" ]; then
((docker pull "php:8.4-rc-zts-alpine3.19" || docker pull "php:8.4-rc-zts-alpine3.19") || true)
&& ((docker pull "$REGISTRY_IMAGE_NAME:8.4-zts-alpine-base" || docker pull "$REGISTRY_IMAGE_NAME:8.4-zts-alpine-base") || true)
&& (docker build --cache-from "php:8.4-rc-zts-alpine3.19" --cache-from "$REGISTRY_IMAGE_NAME:8.4-zts-alpine-base" -t "ci-target:base" ./
|| docker build --cache-from "php:8.4-rc-zts-alpine3.19" --cache-from "$REGISTRY_IMAGE_NAME:8.4-zts-alpine-base" -t "ci-target:base" ./)
; elif [ "${{ matrix.imageName }}" == "8.4-debug-alpine" ]; then
((docker pull "php:8.4-rc-cli-alpine3.19" || docker pull "php:8.4-rc-cli-alpine3.19") || true)
&& ((docker pull "$REGISTRY_IMAGE_NAME:8.4-debug-alpine-base" || docker pull "$REGISTRY_IMAGE_NAME:8.4-debug-alpine-base") || true)
&& (docker build --cache-from "php:8.4-rc-cli-alpine3.19" --cache-from "$REGISTRY_IMAGE_NAME:8.4-debug-alpine-base" -t "ci-target:base" ./
|| docker build --cache-from "php:8.4-rc-cli-alpine3.19" --cache-from "$REGISTRY_IMAGE_NAME:8.4-debug-alpine-base" -t "ci-target:base" ./)
; elif [ "${{ matrix.imageName }}" == "8.4-debian" ]; then
((docker pull "php:8.4-rc-cli-bookworm" || docker pull "php:8.4-rc-cli-bookworm") || true)
&& ((docker pull "$REGISTRY_IMAGE_NAME:8.4-debian-base" || docker pull "$REGISTRY_IMAGE_NAME:8.4-debian-base") || true)
&& (docker build --cache-from "php:8.4-rc-cli-bookworm" --cache-from "$REGISTRY_IMAGE_NAME:8.4-debian-base" -t "ci-target:base" ./
|| docker build --cache-from "php:8.4-rc-cli-bookworm" --cache-from "$REGISTRY_IMAGE_NAME:8.4-debian-base" -t "ci-target:base" ./)
; elif [ "${{ matrix.imageName }}" == "8.4-zts-debian" ]; then
((docker pull "php:8.4-rc-zts-bookworm" || docker pull "php:8.4-rc-zts-bookworm") || true)
&& ((docker pull "$REGISTRY_IMAGE_NAME:8.4-zts-debian-base" || docker pull "$REGISTRY_IMAGE_NAME:8.4-zts-debian-base") || true)
&& (docker build --cache-from "php:8.4-rc-zts-bookworm" --cache-from "$REGISTRY_IMAGE_NAME:8.4-zts-debian-base" -t "ci-target:base" ./
|| docker build --cache-from "php:8.4-rc-zts-bookworm" --cache-from "$REGISTRY_IMAGE_NAME:8.4-zts-debian-base" -t "ci-target:base" ./)
; elif [ "${{ matrix.imageName }}" == "8.4-debug-debian" ]; then
((docker pull "php:8.4-rc-cli-bookworm" || docker pull "php:8.4-rc-cli-bookworm") || true)
&& ((docker pull "$REGISTRY_IMAGE_NAME:8.4-debug-debian-base" || docker pull "$REGISTRY_IMAGE_NAME:8.4-debug-debian-base") || true)
&& (docker build --cache-from "php:8.4-rc-cli-bookworm" --cache-from "$REGISTRY_IMAGE_NAME:8.4-debug-debian-base" -t "ci-target:base" ./
|| docker build --cache-from "php:8.4-rc-cli-bookworm" --cache-from "$REGISTRY_IMAGE_NAME:8.4-debug-debian-base" -t "ci-target:base" ./)
; fi
- name: 'Build base image - build - 8.5.x'
if: (matrix.imageName == '8.5-alpine' || matrix.imageName == '8.5-zts-alpine' || matrix.imageName == '8.5-debug-alpine' || matrix.imageName == '8.5-debian' || matrix.imageName == '8.5-zts-debian' || matrix.imageName == '8.5-debug-debian')
# try to build twice to suppress random network issues with Github Actions
run: >-
cd dlphp/img
&& if [ "${{ matrix.imageName }}" == "8.5-alpine" ]; then
((docker pull "php:8.4-rc-cli-alpine3.19" || docker pull "php:8.4-rc-cli-alpine3.19") || true)
&& ((docker pull "$REGISTRY_IMAGE_NAME:8.5-alpine-base" || docker pull "$REGISTRY_IMAGE_NAME:8.5-alpine-base") || true)
&& (docker build --cache-from "php:8.4-rc-cli-alpine3.19" --cache-from "$REGISTRY_IMAGE_NAME:8.5-alpine-base" -t "ci-target:base" ./
|| docker build --cache-from "php:8.4-rc-cli-alpine3.19" --cache-from "$REGISTRY_IMAGE_NAME:8.5-alpine-base" -t "ci-target:base" ./)
; elif [ "${{ matrix.imageName }}" == "8.5-zts-alpine" ]; then
((docker pull "php:8.4-rc-zts-alpine3.19" || docker pull "php:8.4-rc-zts-alpine3.19") || true)
&& ((docker pull "$REGISTRY_IMAGE_NAME:8.5-zts-alpine-base" || docker pull "$REGISTRY_IMAGE_NAME:8.5-zts-alpine-base") || true)
&& (docker build --cache-from "php:8.4-rc-zts-alpine3.19" --cache-from "$REGISTRY_IMAGE_NAME:8.5-zts-alpine-base" -t "ci-target:base" ./
|| docker build --cache-from "php:8.4-rc-zts-alpine3.19" --cache-from "$REGISTRY_IMAGE_NAME:8.5-zts-alpine-base" -t "ci-target:base" ./)
; elif [ "${{ matrix.imageName }}" == "8.5-debug-alpine" ]; then
((docker pull "php:8.4-rc-cli-alpine3.19" || docker pull "php:8.4-rc-cli-alpine3.19") || true)
&& ((docker pull "$REGISTRY_IMAGE_NAME:8.5-debug-alpine-base" || docker pull "$REGISTRY_IMAGE_NAME:8.5-debug-alpine-base") || true)
&& (docker build --cache-from "php:8.4-rc-cli-alpine3.19" --cache-from "$REGISTRY_IMAGE_NAME:8.5-debug-alpine-base" -t "ci-target:base" ./
|| docker build --cache-from "php:8.4-rc-cli-alpine3.19" --cache-from "$REGISTRY_IMAGE_NAME:8.5-debug-alpine-base" -t "ci-target:base" ./)
; elif [ "${{ matrix.imageName }}" == "8.5-debian" ]; then
((docker pull "php:8.4-rc-cli-bookworm" || docker pull "php:8.4-rc-cli-bookworm") || true)
&& ((docker pull "$REGISTRY_IMAGE_NAME:8.5-debian-base" || docker pull "$REGISTRY_IMAGE_NAME:8.5-debian-base") || true)
&& (docker build --cache-from "php:8.4-rc-cli-bookworm" --cache-from "$REGISTRY_IMAGE_NAME:8.5-debian-base" -t "ci-target:base" ./
|| docker build --cache-from "php:8.4-rc-cli-bookworm" --cache-from "$REGISTRY_IMAGE_NAME:8.5-debian-base" -t "ci-target:base" ./)
; elif [ "${{ matrix.imageName }}" == "8.5-zts-debian" ]; then
((docker pull "php:8.4-rc-zts-bookworm" || docker pull "php:8.4-rc-zts-bookworm") || true)
&& ((docker pull "$REGISTRY_IMAGE_NAME:8.5-zts-debian-base" || docker pull "$REGISTRY_IMAGE_NAME:8.5-zts-debian-base") || true)
&& (docker build --cache-from "php:8.4-rc-zts-bookworm" --cache-from "$REGISTRY_IMAGE_NAME:8.5-zts-debian-base" -t "ci-target:base" ./
|| docker build --cache-from "php:8.4-rc-zts-bookworm" --cache-from "$REGISTRY_IMAGE_NAME:8.5-zts-debian-base" -t "ci-target:base" ./)
; elif [ "${{ matrix.imageName }}" == "8.5-debug-debian" ]; then
((docker pull "php:8.4-rc-cli-bookworm" || docker pull "php:8.4-rc-cli-bookworm") || true)
&& ((docker pull "$REGISTRY_IMAGE_NAME:8.5-debug-debian-base" || docker pull "$REGISTRY_IMAGE_NAME:8.5-debug-debian-base") || true)
&& (docker build --cache-from "php:8.4-rc-cli-bookworm" --cache-from "$REGISTRY_IMAGE_NAME:8.5-debug-debian-base" -t "ci-target:base" ./
|| docker build --cache-from "php:8.4-rc-cli-bookworm" --cache-from "$REGISTRY_IMAGE_NAME:8.5-debug-debian-base" -t "ci-target:base" ./)
; fi
- name: 'Target "basic" - build'
# try to build twice to suppress random network issues with Github Actions
run: >-
sed -i 's~^[ \t]*~~' data/${{ matrix.imageName }}/Dockerfile
&& (docker build -f data/${{ matrix.imageName }}/Dockerfile --target "basic" -t "ci-target:basic" ./
|| docker build -f data/${{ matrix.imageName }}/Dockerfile --target "basic" -t "ci-target:basic" ./)
- name: 'Target "basic" - test'
# try to build twice to suppress random network issues with Github Actions
run: >-
sed -i 's~^[ \t]*~~' data/${{ matrix.imageName }}/Dockerfile
&& (docker build -f data/${{ matrix.imageName }}/Dockerfile --target "basic__test" -t "ci-target:basic__test" ./
|| docker build -f data/${{ matrix.imageName }}/Dockerfile --target "basic__test" -t "ci-target:basic__test" ./)
- name: 'Target "basic" - display layer sizes'
run: >-
docker history --no-trunc --format "table {{.CreatedSince}}\t{{.Size}}\t{{.CreatedBy}}" $(docker inspect --format="{{.Id}}" "ci-target:basic")
&& docker images --no-trunc --format "Total size: {{.Size}}\t{{.ID}}" | grep $(docker inspect --format="{{.Id}}" "ci-target:basic") | cut -f1
- name: 'Target "node" - build'
# try to build twice to suppress random network issues with Github Actions
run: >-
sed -i 's~^[ \t]*~~' data/${{ matrix.imageName }}/Dockerfile
&& (docker build -f data/${{ matrix.imageName }}/Dockerfile --target "node" -t "ci-target:node" ./
|| docker build -f data/${{ matrix.imageName }}/Dockerfile --target "node" -t "ci-target:node" ./)
- name: 'Target "node" - test'
# try to build twice to suppress random network issues with Github Actions
run: >-
sed -i 's~^[ \t]*~~' data/${{ matrix.imageName }}/Dockerfile
&& (docker build -f data/${{ matrix.imageName }}/Dockerfile --target "node__test" -t "ci-target:node__test" ./
|| docker build -f data/${{ matrix.imageName }}/Dockerfile --target "node__test" -t "ci-target:node__test" ./)
- name: 'Target "node" - display layer sizes'
run: >-
docker history --no-trunc --format "table {{.CreatedSince}}\t{{.Size}}\t{{.CreatedBy}}" $(docker inspect --format="{{.Id}}" "ci-target:node")
&& docker images --no-trunc --format "Total size: {{.Size}}\t{{.ID}}" | grep $(docker inspect --format="{{.Id}}" "ci-target:node") | cut -f1
- name: 'Target "selenium" - build'
# try to build twice to suppress random network issues with Github Actions
run: >-
sed -i 's~^[ \t]*~~' data/${{ matrix.imageName }}/Dockerfile
&& (docker build -f data/${{ matrix.imageName }}/Dockerfile --target "selenium" -t "ci-target:selenium" ./
|| docker build -f data/${{ matrix.imageName }}/Dockerfile --target "selenium" -t "ci-target:selenium" ./)
- name: 'Target "selenium" - test'
# try to build twice to suppress random network issues with Github Actions
run: >-
sed -i 's~^[ \t]*~~' data/${{ matrix.imageName }}/Dockerfile
&& (docker build -f data/${{ matrix.imageName }}/Dockerfile --target "selenium__test" -t "ci-target:selenium__test" ./
|| docker build -f data/${{ matrix.imageName }}/Dockerfile --target "selenium__test" -t "ci-target:selenium__test" ./)
- name: 'Target "selenium" - display layer sizes'
run: >-
docker history --no-trunc --format "table {{.CreatedSince}}\t{{.Size}}\t{{.CreatedBy}}" $(docker inspect --format="{{.Id}}" "ci-target:selenium")
&& docker images --no-trunc --format "Total size: {{.Size}}\t{{.ID}}" | grep $(docker inspect --format="{{.Id}}" "ci-target:selenium") | cut -f1
- name: Login to registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY_NAME }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: 'Push tags to registry - 8.3.x'
if: (github.ref == 'refs/heads/master') && (matrix.imageName == '8.3-alpine' || matrix.imageName == '8.3-zts-alpine' || matrix.imageName == '8.3-debug-alpine' || matrix.imageName == '8.3-debian' || matrix.imageName == '8.3-zts-debian' || matrix.imageName == '8.3-debug-debian')
run: >-
dtp() { docker tag "ci-target:$1" "$REGISTRY_IMAGE_NAME:$2" && docker push "$REGISTRY_IMAGE_NAME:$2"; }
&& if [ "${{ matrix.imageName }}" == "8.3-alpine" ]; then
dtp "base" "8.3-base"
&& dtp "base" "8.3-alpine-base"
&& dtp "base" "latest-base"
&& dtp "base" "latest-alpine-base"
&& dtp "basic" "8.3"
&& dtp "basic" "8.3-alpine"
&& dtp "basic" "latest"
&& dtp "basic" "latest-alpine"
&& dtp "node" "8.3-node"
&& dtp "node" "8.3-alpine-node"
&& dtp "node" "latest-node"
&& dtp "node" "latest-alpine-node"
&& dtp "selenium" "8.3-selenium"
&& dtp "selenium" "8.3-alpine-selenium"
&& dtp "selenium" "latest-selenium"
&& dtp "selenium" "latest-alpine-selenium"
; elif [ "${{ matrix.imageName }}" == "8.3-zts-alpine" ]; then
dtp "base" "8.3-zts-base"
&& dtp "base" "8.3-zts-alpine-base"
&& dtp "base" "latest-zts-base"
&& dtp "base" "latest-zts-alpine-base"
&& dtp "basic" "8.3-zts"
&& dtp "basic" "8.3-zts-alpine"
&& dtp "basic" "latest-zts"
&& dtp "basic" "latest-zts-alpine"
&& dtp "node" "8.3-zts-node"
&& dtp "node" "8.3-zts-alpine-node"
&& dtp "node" "latest-zts-node"
&& dtp "node" "latest-zts-alpine-node"
&& dtp "selenium" "8.3-zts-selenium"
&& dtp "selenium" "8.3-zts-alpine-selenium"
&& dtp "selenium" "latest-zts-selenium"
&& dtp "selenium" "latest-zts-alpine-selenium"
; elif [ "${{ matrix.imageName }}" == "8.3-debug-alpine" ]; then
dtp "base" "8.3-debug-base"
&& dtp "base" "8.3-debug-alpine-base"
&& dtp "base" "latest-debug-base"
&& dtp "base" "latest-debug-alpine-base"
&& dtp "basic" "8.3-debug"
&& dtp "basic" "8.3-debug-alpine"
&& dtp "basic" "latest-debug"
&& dtp "basic" "latest-debug-alpine"
&& dtp "node" "8.3-debug-node"
&& dtp "node" "8.3-debug-alpine-node"
&& dtp "node" "latest-debug-node"
&& dtp "node" "latest-debug-alpine-node"
&& dtp "selenium" "8.3-debug-selenium"
&& dtp "selenium" "8.3-debug-alpine-selenium"
&& dtp "selenium" "latest-debug-selenium"
&& dtp "selenium" "latest-debug-alpine-selenium"
; elif [ "${{ matrix.imageName }}" == "8.3-debian" ]; then
dtp "base" "8.3-debian-base"
&& dtp "base" "latest-debian-base"
&& dtp "basic" "8.3-debian"
&& dtp "basic" "latest-debian"
&& dtp "node" "8.3-debian-node"
&& dtp "node" "latest-debian-node"
&& dtp "selenium" "8.3-debian-selenium"
&& dtp "selenium" "latest-debian-selenium"
; elif [ "${{ matrix.imageName }}" == "8.3-zts-debian" ]; then
dtp "base" "8.3-zts-debian-base"
&& dtp "base" "latest-zts-debian-base"
&& dtp "basic" "8.3-zts-debian"
&& dtp "basic" "latest-zts-debian"
&& dtp "node" "8.3-zts-debian-node"
&& dtp "node" "latest-zts-debian-node"
&& dtp "selenium" "8.3-zts-debian-selenium"
&& dtp "selenium" "latest-zts-debian-selenium"
; elif [ "${{ matrix.imageName }}" == "8.3-debug-debian" ]; then
dtp "base" "8.3-debug-debian-base"
&& dtp "base" "latest-debug-debian-base"
&& dtp "basic" "8.3-debug-debian"
&& dtp "basic" "latest-debug-debian"
&& dtp "node" "8.3-debug-debian-node"
&& dtp "node" "latest-debug-debian-node"
&& dtp "selenium" "8.3-debug-debian-selenium"
&& dtp "selenium" "latest-debug-debian-selenium"
; fi
- name: 'Push tags to registry - 8.4.x'
if: (github.ref == 'refs/heads/master') && (matrix.imageName == '8.4-alpine' || matrix.imageName == '8.4-zts-alpine' || matrix.imageName == '8.4-debug-alpine' || matrix.imageName == '8.4-debian' || matrix.imageName == '8.4-zts-debian' || matrix.imageName == '8.4-debug-debian')
run: >-
dtp() { docker tag "ci-target:$1" "$REGISTRY_IMAGE_NAME:$2" && docker push "$REGISTRY_IMAGE_NAME:$2"; }
&& if [ "${{ matrix.imageName }}" == "8.4-alpine" ]; then
dtp "base" "8.4-base"
&& dtp "base" "8.4-alpine-base"
&& dtp "basic" "8.4"
&& dtp "basic" "8.4-alpine"
&& dtp "node" "8.4-node"
&& dtp "node" "8.4-alpine-node"
&& dtp "selenium" "8.4-selenium"
&& dtp "selenium" "8.4-alpine-selenium"
; elif [ "${{ matrix.imageName }}" == "8.4-zts-alpine" ]; then
dtp "base" "8.4-zts-base"
&& dtp "base" "8.4-zts-alpine-base"
&& dtp "basic" "8.4-zts"
&& dtp "basic" "8.4-zts-alpine"
&& dtp "node" "8.4-zts-node"
&& dtp "node" "8.4-zts-alpine-node"
&& dtp "selenium" "8.4-zts-selenium"
&& dtp "selenium" "8.4-zts-alpine-selenium"
; elif [ "${{ matrix.imageName }}" == "8.4-debug-alpine" ]; then
dtp "base" "8.4-debug-base"
&& dtp "base" "8.4-debug-alpine-base"
&& dtp "basic" "8.4-debug"
&& dtp "basic" "8.4-debug-alpine"
&& dtp "node" "8.4-debug-node"
&& dtp "node" "8.4-debug-alpine-node"
&& dtp "selenium" "8.4-debug-selenium"
&& dtp "selenium" "8.4-debug-alpine-selenium"
; elif [ "${{ matrix.imageName }}" == "8.4-debian" ]; then
dtp "base" "8.4-debian-base"
&& dtp "basic" "8.4-debian"
&& dtp "node" "8.4-debian-node"
&& dtp "selenium" "8.4-debian-selenium"
; elif [ "${{ matrix.imageName }}" == "8.4-zts-debian" ]; then
dtp "base" "8.4-zts-debian-base"
&& dtp "basic" "8.4-zts-debian"
&& dtp "node" "8.4-zts-debian-node"
&& dtp "selenium" "8.4-zts-debian-selenium"
; elif [ "${{ matrix.imageName }}" == "8.4-debug-debian" ]; then
dtp "base" "8.4-debug-debian-base"
&& dtp "basic" "8.4-debug-debian"
&& dtp "node" "8.4-debug-debian-node"
&& dtp "selenium" "8.4-debug-debian-selenium"
; fi
- name: 'Push tags to registry - 8.5.x'
if: (github.ref == 'refs/heads/master') && (matrix.imageName == '8.5-alpine' || matrix.imageName == '8.5-zts-alpine' || matrix.imageName == '8.5-debug-alpine' || matrix.imageName == '8.5-debian' || matrix.imageName == '8.5-zts-debian' || matrix.imageName == '8.5-debug-debian')
run: >-
dtp() { docker tag "ci-target:$1" "$REGISTRY_IMAGE_NAME:$2" && docker push "$REGISTRY_IMAGE_NAME:$2"; }
&& if [ "${{ matrix.imageName }}" == "8.5-alpine" ]; then
dtp "base" "8.5-base"
&& dtp "base" "8.5-alpine-base"
&& dtp "basic" "8.5"
&& dtp "basic" "8.5-alpine"
&& dtp "node" "8.5-node"
&& dtp "node" "8.5-alpine-node"
&& dtp "selenium" "8.5-selenium"
&& dtp "selenium" "8.5-alpine-selenium"
; elif [ "${{ matrix.imageName }}" == "8.5-zts-alpine" ]; then
dtp "base" "8.5-zts-base"
&& dtp "base" "8.5-zts-alpine-base"
&& dtp "basic" "8.5-zts"
&& dtp "basic" "8.5-zts-alpine"
&& dtp "node" "8.5-zts-node"
&& dtp "node" "8.5-zts-alpine-node"
&& dtp "selenium" "8.5-zts-selenium"
&& dtp "selenium" "8.5-zts-alpine-selenium"
; elif [ "${{ matrix.imageName }}" == "8.5-debug-alpine" ]; then
dtp "base" "8.5-debug-base"
&& dtp "base" "8.5-debug-alpine-base"
&& dtp "basic" "8.5-debug"
&& dtp "basic" "8.5-debug-alpine"
&& dtp "node" "8.5-debug-node"
&& dtp "node" "8.5-debug-alpine-node"
&& dtp "selenium" "8.5-debug-selenium"
&& dtp "selenium" "8.5-debug-alpine-selenium"
; elif [ "${{ matrix.imageName }}" == "8.5-debian" ]; then
dtp "base" "8.5-debian-base"
&& dtp "basic" "8.5-debian"
&& dtp "node" "8.5-debian-node"
&& dtp "selenium" "8.5-debian-selenium"
; elif [ "${{ matrix.imageName }}" == "8.5-zts-debian" ]; then
dtp "base" "8.5-zts-debian-base"
&& dtp "basic" "8.5-zts-debian"
&& dtp "node" "8.5-zts-debian-node"
&& dtp "selenium" "8.5-zts-debian-selenium"
; elif [ "${{ matrix.imageName }}" == "8.5-debug-debian" ]; then
dtp "base" "8.5-debug-debian-base"
&& dtp "basic" "8.5-debug-debian"
&& dtp "node" "8.5-debug-debian-node"
&& dtp "selenium" "8.5-debug-debian-selenium"
; fi