Update .gitlab-ci.yml

This commit is contained in:
Romain Delanoë
2021-10-01 19:55:46 +00:00
parent 86a81d367e
commit c253961c2f

View File

@@ -1,20 +1,58 @@
FROM php:7.4 image: lorisleiva/laravel-docker:latest
# Update packages # Replace the last line with the following lines if you'd rather
RUN apt-get update # leave StrictHostKeyChecking enabled (replace yourdomain.com):
#
# ssh-keyscan yourdomain.com >> ~/.ssh/known_hosts
# chmod 644 ~/.ssh/known_hosts
# Install PHP and composer dependencies .change_file_permissions: &change_file_permissions |
RUN apt-get install -qq git curl libmcrypt-dev libjpeg-dev libpng-dev libfreetype6-dev libbz2-dev find . -type f -not -path "./vendor/*" -exec chmod 664 {} \;
find . -type d -not -path "./vendor/*" -exec chmod 775 {} \;
# Clear out the local repository of retrieved package files composer:
RUN apt-get clean stage: build
cache:
key: ${CI_COMMIT_REF_SLUG}-composer
paths:
- vendor/
script:
- composer install --prefer-dist --no-ansi --no-interaction --no-progress --no-scripts
- cp .env.example .env
- php artisan key:generate
artifacts:
expire_in: 1 month
paths:
- vendor/
- .env
# Install needed extensions npm:
# Here you can install any other extension that you need during the test and deployment process stage: build
RUN docker-php-ext-install mcrypt pdo_mysql zip cache:
key: ${CI_COMMIT_REF_SLUG}-npm
paths:
- node_modules/
script:
- npm install
- npm run production
artifacts:
expire_in: 1 month
paths:
- node_modules/
- public/css/
- public/js/
# Install Composer
RUN curl --silent --show-error "https://getcomposer.org/installer" | php -- --install-dir=/usr/local/bin --filename=composer
# Install Laravel Envoy codestyle:
RUN composer global require "laravel/envoy=~1.0" stage: test
dependencies: []
script:
- phpcs --standard=PSR2 --extensions=php --ignore=app/Support/helpers.php app
phpunit:
stage: test
dependencies:
- composer
script:
- phpunit --coverage-text --colors=never