From c511f1a70b14f62663d4fec48b7d7207f9b3de68 Mon Sep 17 00:00:00 2001 From: Daniel Siepmann Date: Sat, 8 Apr 2017 23:23:09 +0200 Subject: [PATCH] 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. --- .gitlab-ci.yml | 23 +++++++++++++++-------- Makefile | 11 ++++++++++- 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 54161e5..38fb4e2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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 diff --git a/Makefile b/Makefile index 432e039..13e7363 100644 --- a/Makefile +++ b/Makefile @@ -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