WIP|FEATURE: Test on multiple php versions

* Use different jobs to run in parallel.
* Use different docker image for each php version.
* Provide common way to install composer on each image.
This commit is contained in:
Daniel Siepmann 2017-04-08 23:23:09 +02:00
parent a2eb6d799d
commit c511f1a70b
Signed by: Daniel Siepmann
GPG key ID: 33D6629915560EF4
2 changed files with 25 additions and 9 deletions

View file

@ -1,18 +1,25 @@
image: 'composer:latest'
before_script:
- apk add --no-cache make
- >
composer install
--optimize-autoloader
--no-interaction
--no-ansi
apt-get update
&& apt-get install -y
make
wget
--no-install-recommends
&& rm -r /var/lib/apt/lists/*
- make install-composer
- make install
stages:
- test
test:functional:
test:5.6:
image: php:5.6
stage: test
script:
- ./vendor/bin/phpunit
test:7.0:
image: php:7.0
stage: test
script:
- ./vendor/bin/phpunit

View file

@ -4,7 +4,7 @@ DEFAULT_STANDARD = Typo3Update
CUSTOM_STANDARDS = $(abspath ./src/Standards/)
install:
composer install
composer install --optimize-autoloader --no-interaction --no-ansi
$(BIN_PHPCS) --config-set installed_paths $(CUSTOM_STANDARDS)
$(BIN_PHPCS) -i | grep Typo3Update
$(BIN_PHPCS) --config-set default_standard $(DEFAULT_STANDARD)
@ -14,3 +14,12 @@ test-search:
$(BIN_PHPCS) -p --colors -s PROJECT_PATH
test-fix:
$(BIN_PHPCBF) -p --colors -s PROJECT_PATH
# For CI:
install-composer:
wget https://composer.github.io/installer.sig -O - -q | tr -d '\n' > installer.sig
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('SHA384', 'composer-setup.php') === file_get_contents('installer.sig')) { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php'); unlink('installer.sig');"
php composer.phar install