Skip to content

Instantly share code, notes, and snippets.

@ahmed-bhs
Created March 19, 2020 14:25
Show Gist options
  • Save ahmed-bhs/d206386f8daa935032b2e3017efccd0b to your computer and use it in GitHub Desktop.
Save ahmed-bhs/d206386f8daa935032b2e3017efccd0b to your computer and use it in GitHub Desktop.
stages:
- composer_validate
- static_analysis
- tests
# overlay2 storage driver is more fast, default is vfs.
variables:
DOCKER_DRIVER: overlay2
cache:
paths:
- vendor/
php-unit:
stage: tests
image: jakzal/phpqa:php7.3-alpine
script: "vendor/bin/simple-phpunit --stop-on-failure"
before_script: # Run composer update --lock in case of the lock file is not up to date
- composer install --no-scripts --no-interaction --no-suggest --ansi
phpstan:
stage: static_analysis
image: edbizarro/gitlab-ci-pipeline-php:7.3-alpine
script: vendor/bin/phpstan analyse -c .ci/phpstan.neon src tests
allow_failure: true
before_script:
- composer install --no-scripts --no-interaction --no-suggest --ansi
only:
changes:
- src/**/*
- tests/**/*
php-phpmd:
image: jakzal/phpqa:php7.3-alpine
stage: static_analysis
script: phpmd src text .ci/phpmd.xml
artifacts:
expire_in: 10 days
paths:
- var/phpmd.html
only:
changes:
- src/**/*
- tests/**/*
allow_failure: true
phpcpd:
image: jakzal/phpqa:php7.3-alpine
stage: static_analysis
script:
- phpcpd src tests
only:
changes:
- src/**/*
- tests/**/*
composer-validate:
image: edbizarro/gitlab-ci-pipeline-php:7.3-alpine
stage: composer_validate
script:
- composer validate
only:
changes:
- composer.json
- composer.lock
phpcsfixer:
stage: static_analysis
image: jakzal/phpqa:php7.3-alpine
script:
- php-cs-fixer fix --dry-run --diff --config=.ci/csfixer_ruleset.php
only:
changes:
- src/**/*
- tests/**/*
php-deprecation-detector:
image: jakzal/phpqa:php7.3-alpine
stage: static_analysis
script:
- deprecation-detector check src/ tests/
only:
changes:
- src/**/*
- tests/**/*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment