mirror of
https://github.com/chialab/docker-php.git
synced 2026-08-24 02:24:16 -05:00
108 lines
3.8 KiB
YAML
108 lines
3.8 KiB
YAML
name: Test PHP 7 images
|
|
|
|
on:
|
|
schedule:
|
|
# chosen by fair dice roll
|
|
- cron: '42 18 * * 4'
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
types: [opened, synchronize]
|
|
|
|
jobs:
|
|
test-7:
|
|
name: Build and test PHP 7 images
|
|
runs-on: ubuntu-22.04
|
|
if: ${{ !contains(github.event.commits[0].message, '[skip ci]') && !contains(github.event.commits[0].message, '[ci skip]') }}
|
|
strategy:
|
|
matrix:
|
|
version: [ '7.0', '7.1', '7.2', '7.3', '7.4' ]
|
|
flavor: [ '', '-apache', '-fpm', '-alpine', '-fpm-alpine' ]
|
|
exclude:
|
|
- version: '7.0'
|
|
flavor: '-alpine'
|
|
- version: '7.0'
|
|
flavor: '-fpm-alpine'
|
|
services:
|
|
registry:
|
|
image: registry:2
|
|
ports:
|
|
- 5000:5000
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Login to DockerHub
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ secrets.DOCKER_PULL_USER_2 }}
|
|
password: ${{ secrets.DOCKER_PULL_PASS_2 }}
|
|
|
|
- name: Build image for testing
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
# cache-from: type=registry,ref=ghcr.io/chialab/php:${{ matrix.version }}${{ matrix.flavor }}
|
|
cache-to: type=inline
|
|
context: .
|
|
file: ${{ ((contains(matrix.flavor, 'alpine') || matrix.version == 'alpine') && 'Dockerfile.alpine') || 'Dockerfile' }}
|
|
build-args: |
|
|
BASE_IMAGE=php:${{ matrix.version }}${{ matrix.flavor }}
|
|
tags: localhost:5000/chialab/php:${{ matrix.version }}${{ matrix.flavor }}
|
|
push: true
|
|
|
|
- name: Test image
|
|
env:
|
|
REGISTRY: localhost:5000/
|
|
VERSION: ${{ matrix.version }}${{ matrix.flavor }}
|
|
run: 'docker pull localhost:5000/chialab/php:${{ matrix.version }}${{ matrix.flavor }} && make test'
|
|
|
|
- name: Build dev image for testing
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
cache-to: type=inline
|
|
context: ./dev
|
|
build-args: |
|
|
BASE_IMAGE=localhost:5000/chialab/php:${{ matrix.version }}${{ matrix.flavor }}
|
|
tags: localhost:5000/chialab/php-dev:${{ matrix.version }}${{ matrix.flavor }}
|
|
push: true
|
|
|
|
- name: Test dev image
|
|
env:
|
|
REGISTRY: localhost:5000/
|
|
VERSION: ${{ matrix.version }}${{ matrix.flavor }}
|
|
run: 'docker pull localhost:5000/chialab/php-dev:${{ matrix.version }}${{ matrix.flavor }} && make -C dev test'
|
|
|
|
- name: Build PCOV image for testing
|
|
if: ${{ matrix.version >= 7.1 }}
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
cache-to: type=inline
|
|
context: ./pcov
|
|
build-args: |
|
|
BASE_IMAGE=localhost:5000/chialab/php:${{ matrix.version }}${{ matrix.flavor }}
|
|
tags: localhost:5000/chialab/php-pcov:${{ matrix.version }}${{ matrix.flavor }}
|
|
push: true
|
|
|
|
- name: Test PCOV image
|
|
if: ${{ matrix.version >= 7.1 }}
|
|
env:
|
|
REGISTRY: localhost:5000/
|
|
VERSION: ${{ matrix.version }}${{ matrix.flavor }}
|
|
run: 'docker pull localhost:5000/chialab/php-pcov:${{ matrix.version }}${{ matrix.flavor }} && make -C pcov test'
|
|
|
|
- name: Build xhprof image for testing
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
cache-to: type=inline
|
|
context: ./xhprof
|
|
build-args: |
|
|
BASE_IMAGE=localhost:5000/chialab/php:${{ matrix.version }}${{ matrix.flavor }}
|
|
tags: localhost:5000/chialab/php-xhprof:${{ matrix.version }}${{ matrix.flavor }}
|
|
push: true
|
|
|
|
- name: Test xhprof image
|
|
env:
|
|
REGISTRY: localhost:5000/
|
|
VERSION: ${{ matrix.version }}${{ matrix.flavor }}
|
|
run: 'docker pull localhost:5000/chialab/php-xhprof:${{ matrix.version }}${{ matrix.flavor }} && make -C xhprof test'
|