Skip to content

CI

CI #2904

Workflow file for this run

name: CI
on:
workflow_dispatch:
inputs:
build-mode:
description: 'Build mode: --build-all or --build-new'
default: '--build-new'
required: false
php-source:
description: 'PHP source: --web-php or --php-src'
default: ''
required: false
php-versions:
description: 'PHP version to build'
default: '5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3 8.4 8.5 8.6'
required: false
container-os-versions:
description: 'OS versions to build on'
default: 'ubuntu:22.04 ubuntu:24.04 ubuntu:26.04 arm64v8/ubuntu:22.04 arm64v8/ubuntu:24.04 arm64v8/ubuntu:26.04 debian:11 debian:12 debian:trixie'
required: false
schedule:
- cron: '0 0 1-31/2 * *'
permissions:
actions: write
contents: read
env:
CONTAINER_OS_LIST: ubuntu:22.04 ubuntu:24.04 ubuntu:26.04 arm64v8/ubuntu:22.04 arm64v8/ubuntu:24.04 arm64v8/ubuntu:26.04 debian:11 debian:12 debian:trixie
PHP_LIST: 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3 8.4 8.5 8.6
PHP_SOURCE: --web-php
jobs:
get-php-versions:
runs-on: ubuntu-latest
outputs:
has_versions: ${{ steps.set-php-versions.outputs.has_versions }}
php_versions: ${{ steps.set-php-versions.outputs.php_versions }}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Get PHP versions
id: set-php-versions
env:
COMMIT: ${{ github.event.head_commit.message || inputs.build-mode }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PHP_LIST: ${{ inputs.php-versions || env.PHP_LIST }}
PHP_SOURCE: ${{ inputs.php-source || env.PHP_SOURCE }}
run: bash scripts/get-php-versions.sh
dispatch-builds:
needs: get-php-versions
if: needs.get-php-versions.outputs.has_versions == 'true'
runs-on: ubuntu-latest
env:
BUILD_MODE: ${{ inputs.build-mode || '--build-new' }}
CONTAINER_OS_VERSIONS: ${{ inputs.container-os-versions || 'ubuntu:22.04 ubuntu:24.04 ubuntu:26.04 arm64v8/ubuntu:22.04 arm64v8/ubuntu:24.04 arm64v8/ubuntu:26.04 debian:11 debian:12 debian:trixie' }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PHP_SOURCE: ${{ github.event.inputs.php-source }}
PHP_VERSIONS: ${{ needs.get-php-versions.outputs.php_versions }}
REF: ${{ github.head_ref || github.ref_name }}
steps:
- name: Dispatch build workflows
run: |
jq -r '.[]' <<< "$PHP_VERSIONS" | while read -r php_version; do
gh workflow run build.yml \
--repo "$GITHUB_REPOSITORY" \
--ref "$REF" \
--field build-mode="$BUILD_MODE" \
--field container-os-versions="$CONTAINER_OS_VERSIONS" \
--field php-source="$PHP_SOURCE" \
--field php-version="$php_version"
done