Sign inSign up

kchason/php-ci

By kchason

•Updated 27 days ago

Forks of PHP images to more optimally support CI jobs

Image
0

7.4K

kchason/php-ci repository overview

⁠PHP CI Tools

⁠Description

Provides PHP containers with Composer, xdebug, and other tools pre-installed for easier continuous integration runs.

⁠Dockerfile

ARG PHP_VERSION=""

FROM php:${PHP_VERSION}-cli

# Install composer and extensions
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer &&\
    apt-get update && apt-get install -y libzip-dev libxml2-dev libsodium-dev unzip libicu-dev &&\
    apt-get clean -y &&\
    docker-php-ext-install zip pdo intl soap sodium &&\
    pecl install xdebug &&\
    docker-php-ext-enable xdebug

⁠Usage

⁠GitLab CI
Pint (PHP Lint):
  stage: lint
  image: kchason/php-ci:latest
  before_script:
    - composer require laravel/pint --dev
  script:
    - vendor/bin/pint
  tags:
    - docker

PHP Unit:
  stage: test
  image: kchason/php-ci:latest
  variables:
    XDEBUG_MODE: coverage
  before_script:
    - composer require phpunit/phpunit --dev
  script:
    - vendor/bin/phpunit --coverage-text --colors=never --coverage-cobertura cobertura.xml --log-junit junit.xml
  coverage: /^\s*Lines:\s*\d+.\d+\%/ # Regex to match coverage line
  artifacts:
    reports:
      junit: junit.xml
      coverage_report:
        coverage_format: cobertura
	path: cobertura.xml
  tags:
    - docker

Tag summary

Content type

Image

Digest

sha256:94dc0436d…

Size

229.4 MB

Last updated

27 days ago

docker pull kchason/php-ci