use cache for composer home

This commit is contained in:
Julien Fastré 2021-08-17 21:47:24 +02:00
parent fbc7cf3954
commit c7c62dc10b

View File

@ -5,12 +5,13 @@ image: registry.gitlab.com/chill-projet/chill-app/php-base-image:7.4
cache: cache:
paths: paths:
- tests/app/vendor/ - tests/app/vendor/
- /tmp/composer-cache - .composer
before_script: before_script:
# add extensions to postgres # add extensions to postgres
- PGPASSWORD=$POSTGRES_PASSWORD psql -U $POSTGRES_USER -h db -c "CREATE EXTENSION IF NOT EXISTS unaccent; CREATE EXTENSION IF NOT EXISTS pg_trgm;" - PGPASSWORD=$POSTGRES_PASSWORD psql -U $POSTGRES_USER -h db -c "CREATE EXTENSION IF NOT EXISTS unaccent; CREATE EXTENSION IF NOT EXISTS pg_trgm;"
# Install and run Composer # Install and run Composer
- mkdir -p $COMPOSER_HOME
- curl -sS https://getcomposer.org/installer | php - curl -sS https://getcomposer.org/installer | php
- php -d memory_limit=2G composer.phar install - php -d memory_limit=2G composer.phar install
- php tests/app/bin/console doctrine:migrations:migrate -n - php tests/app/bin/console doctrine:migrations:migrate -n
@ -38,7 +39,7 @@ variables:
# change vendor dir to make the app install into tests/apps # change vendor dir to make the app install into tests/apps
COMPOSER_VENDOR_DIR: tests/app/vendor COMPOSER_VENDOR_DIR: tests/app/vendor
# cache some composer data # cache some composer data
COMPOSER_HOME: /tmp/composer-cache COMPOSER_HOME: .composer
# Run our tests # Run our tests