From d7bc93580f3646411b350065989658dc7b84393f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 20 Apr 2021 18:15:04 +0200 Subject: [PATCH] fix gitlab-ci --- .gitlab-ci.yml | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b500e52db..73c3c9f7f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,11 +1,10 @@ -# This file is a template, and might need editing before it works on your project. -# Select image from https://hub.docker.com/_/php/ +--- image: php:7.4 # Select what we should cache between builds cache: paths: - - vendor/ + - tests/app/vendor/ before_script: - apt-get update -yqq @@ -13,34 +12,40 @@ before_script: # Install PHP extensions - docker-php-ext-configure gd --with-freetype --with-jpeg - docker-php-ext-install intl pdo_pgsql mbstring zip bcmath sockets exif - - mkdir /tmp/redis \ - && curl -L -o /tmp/redis/redis.tar.gz https://github.com/phpredis/phpredis/archive/$PHPREDIS_VERSION.tar.gz \ - && cd /tmp/redis \ - && tar xfz /tmp/redis/redis.tar.gz \ - && rm -r /tmp/redis/redis.tar.gz \ - && mkdir -p /usr/src/php/ext/redis \ - && mv /tmp/redis/phpredis-$PHPREDIS_VERSION/* /usr/src/php/ext/redis/. \ - && docker-php-ext-install redis + - > + mkdir /tmp/redis \ + && curl -L -o /tmp/redis/redis.tar.gz https://github.com/phpredis/phpredis/archive/$PHPREDIS_VERSION.tar.gz \ + && cd /tmp/redis \ + && tar xfz /tmp/redis/redis.tar.gz \ + && rm -r /tmp/redis/redis.tar.gz \ + && mkdir -p /usr/src/php/ext/redis \ + && mv /tmp/redis/phpredis-$PHPREDIS_VERSION/* /usr/src/php/ext/redis/. \ + && docker-php-ext-install redis # Install & enable Xdebug for code coverage reports # - pecl install xdebug - #- docker-php-ext-enable xdebug + # - docker-php-ext-enable xdebug # Install and run Composer - curl -sS https://getcomposer.org/installer | php - php composer.phar install + - php tests/app/bin/console doctrine:migrations:migrate -n + - php tests/app/bin/console doctrine:fixtures:load -n + # Bring in any services we need http://docs.gitlab.com/ee/ci/docker/using_docker_images.html#what-is-a-service # See http://docs.gitlab.com/ee/ci/services/README.html for examples. services: - - postgresql:12 + - name: postgresql:12 + alias: db # Set any variables we need variables: # Configure postgres environment variables (https://hub.docker.com/r/_/postgres/) - POSTGRES_USER=postgres - POSTGRES_PASSWORD=postgres + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + # fetch the chill-app using git submodules + GIT_SUBMODULE_STRATEGY: recursive # Run our tests -# If Xdebug was installed you can generate a coverage report and see code coverage metrics. test: script: - bin/phpunit --colors=never