Skip to content

Instantly share code, notes, and snippets.

@rubemlrm
Created October 4, 2017 15:03
Show Gist options
  • Save rubemlrm/568b45e181333d306a8d21d413e31379 to your computer and use it in GitHub Desktop.
Save rubemlrm/568b45e181333d306a8d21d413e31379 to your computer and use it in GitHub Desktop.
gitlab-ci multiple tasks
phpcs:
# This file is a template, and might need editing before it works on your project.
# Select image from https://hub.docker.com/_/php/
image: rubemlrm/php-docker:7.1-apache
# Select what we should cache between builds
cache:
paths:
- vendor/
before_script:
- apt-get update -yqq
- apt-get install -yqq git libmcrypt-dev libpq-dev libcurl4-gnutls-dev libicu-dev libvpx-dev libjpeg-dev libpng-dev libxpm-dev zlib1g-dev libfreetype6-dev libxml2-dev libexpat1-dev libbz2-dev libgmp3-dev libldap2-dev unixodbc-dev libsqlite3-dev libaspell-dev libsnmp-dev libpcre3-dev libtidy-dev
# Install PHP extensions
- docker-php-ext-install mbstring mcrypt pdo_pgsql curl json intl gd xml zip bz2 opcache
# Install and run Composer
- curl -sS https://getcomposer.org/installer | php
- php composer.phar install
- mv .env.example .env
- php artisan key:generate
# 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/ce/ci/services/README.html for examples.
services:
- mysql:5.7
# Set any variables we need
variables:
# Configure mysql environment variables (https://hub.docker.com/r/_/mysql/)
MYSQL_DATABASE: development
MYSQL_ROOT_PASSWORD: teste123
# Run our tests
# If Xdebug was installed you can generate a coverage report and see code coverage metrics.
script:
- php vendor/bin/phpcs --config-set ignore_warnings_on_exit 1
- php vendor/bin/phpcs --standard=PSR2 --ignore=resources,storage,tests -w --colors app/
artifacts:
paths:
- coverage
phpmd:
# This file is a template, and might need editing before it works on your project.
# Select image from https://hub.docker.com/_/php/
image: rubemlrm/php-docker:7.1-apache
# Select what we should cache between builds
cache:
paths:
- vendor/
before_script:
- apt-get update -yqq
- apt-get install -yqq git libmcrypt-dev libpq-dev libcurl4-gnutls-dev libicu-dev libvpx-dev libjpeg-dev libpng-dev libxpm-dev zlib1g-dev libfreetype6-dev libxml2-dev libexpat1-dev libbz2-dev libgmp3-dev libldap2-dev unixodbc-dev libsqlite3-dev libaspell-dev libsnmp-dev libpcre3-dev libtidy-dev
# Install PHP extensions
- docker-php-ext-install mbstring mcrypt pdo_pgsql curl json intl gd xml zip bz2 opcache
# Install and run Composer
- curl -sS https://getcomposer.org/installer | php
- php composer.phar install
- mv .env.example .env
- php artisan key:generate
# 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/ce/ci/services/README.html for examples.
services:
- mysql:5.7
# Set any variables we need
variables:
# Configure mysql environment variables (https://hub.docker.com/r/_/mysql/)
MYSQL_DATABASE: development
MYSQL_ROOT_PASSWORD: teste123
# Run our tests
# If Xdebug was installed you can generate a coverage report and see code coverage metrics.
script:
- php vendor/bin/phpmd app/ text cleancode,controversial,codesize,design,naming,unusedcode
allow_failure: false
phpunit:
# This file is a template, and might need editing before it works on your project.
# Select image from https://hub.docker.com/_/php/
image: rubemlrm/php-docker:7.1-apache
# Select what we should cache between builds
cache:
paths:
- vendor/
before_script:
- apt-get update -yqq
- apt-get install -yqq git libmcrypt-dev libpq-dev libcurl4-gnutls-dev libicu-dev libvpx-dev libjpeg-dev libpng-dev libxpm-dev zlib1g-dev libfreetype6-dev libxml2-dev libexpat1-dev libbz2-dev libgmp3-dev libldap2-dev unixodbc-dev libsqlite3-dev libaspell-dev libsnmp-dev libpcre3-dev libtidy-dev
# Install PHP extensions
- docker-php-ext-install mbstring mcrypt pdo_pgsql curl json intl gd xml zip bz2 opcache
# Install and run Composer
- curl -sS https://getcomposer.org/installer | php
- php composer.phar install
- mv .env.example .env
- php artisan key:generate
# 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/ce/ci/services/README.html for examples.
services:
- mysql:5.7
# Set any variables we need
variables:
# Configure mysql environment variables (https://hub.docker.com/r/_/mysql/)
MYSQL_DATABASE: development
MYSQL_ROOT_PASSWORD: teste123
script:
- vendor/bin/phpunit --configuration phpunit.xml
javascript:
image: node:latest
# This folder is cached between builds
# http://docs.gitlab.com/ce/ci/yaml/README.html#cache
cache:
paths:
- node_modules/
script:
- npm install
- npm install -g standard eslint-plugin-html
- standard --plugin html 'resources/assets/js/**/*.{js,vue}'
allow_failure: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment