name: Test PHP 5 images on: schedule: # chosen by fair dice roll - cron: '42 18 * * 5' push: branches: [main] pull_request: types: [opened, synchronize] jobs: test-5: name: Build and test PHP 5 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: [ '5.6' ] flavor: [ '', '-apache', '-fpm', '-alpine', '-fpm-alpine' ] exclude: - version: '5.6' flavor: '-alpine' - version: '5.6' 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_1 }} password: ${{ secrets.DOCKER_PULL_PASS_1 }} - 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 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'