master
Anton Smirnov 1 year ago
parent dce3a58477
commit 9e438c2a2c
  1. 69
      .gitlab-ci.yml

@ -0,0 +1,69 @@
stages:
- test
- report
cache:
key: composer-cache
paths:
- .composer-cache/
.test:
before_script:
# install system packages
- apt-get update && apt-get install -y git unzip
# install extensions
- if [ "$INSTALL_XDEBUG" -eq 1 ]; then curl --location https://github.com/FriendsOfPHP/pickle/releases/latest/download/pickle.phar --output pickle.phar; php pickle.phar install --defaults xdebug; docker-php-ext-enable xdebug; fi
# install composer
- php -r "copy('https://composer.github.io/installer.sig', '/tmp/composer.sig');"
- php -r "copy('https://getcomposer.org/installer', '/tmp/composer-setup.php');"
- php -r '$expected = file_get_contents("/tmp/composer.sig"); $actual = hash_file("sha384", "/tmp/composer-setup.php"); exit(intval(!hash_equals($expected, $actual)));'
- php /tmp/composer-setup.php --install-dir=/usr/local/bin --filename=composer
- chmod +x /usr/local/bin/composer
- rm /tmp/composer-setup.php /tmp/composer.sig
# cache dependencies
- composer config -g cache-dir "$(pwd)/.composer-cache"
script:
- composer update
- vendor/bin/phpunit
# lowest version with lowest dependencies
test-7.4-lowest:
extends: .test
stage: test
image: php:7.4
script:
- composer update --prefer-lowest
- vendor/bin/phpunit
# lowest version
test-7.4:
extends: .test
stage: test
image: php:7.4
## current release
test-8.0:
extends: .test
stage: test
image: php:8.0
# latest unstable
test-rc:
extends: .test
stage: test
image: php:rc
allow_failure: true
# coverage
coverage:
variables:
INSTALL_XDEBUG: 1
extends: .test
stage: report
only:
- master
image: php:8.0
script:
- composer update
- XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-clover coverage.xml
- bash <(curl -s https://codecov.io/bash)
Loading…
Cancel
Save