Skip to content

Instantly share code, notes, and snippets.

@amitavroy
Last active January 25, 2019 23:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amitavroy/40000cc4845a0b3824ed36812791b151 to your computer and use it in GitHub Desktop.
Save amitavroy/40000cc4845a0b3824ed36812791b151 to your computer and use it in GitHub Desktop.
Continuous Integration with Gitlab
stages:
- test
# Variables: these have to match
# the .env.example credentials in your Laravel app
# use the default homestead/secret combination, since
# that database gets created in the edbizarro/gitlab-ci-pipeline-php:7.1
# docker image.
variables:
MYSQL_ROOT_PASSWORD: root
MYSQL_USER: homestead
MYSQL_PASSWORD: secret
MYSQL_DATABASE: homestead
DB_HOST: mysql
# Speed up builds
cache:
key: $CI_COMMIT_REF_NAME # changed to $CI_COMMIT_REF_NAME in Gitlab 9.x
paths:
- vendor
- node_modules
- public
- .yarn
test:
stage: test
services:
- mysql:5.7
image: edbizarro/gitlab-ci-pipeline-php:7.1
script:
- yarn config set cache-folder .yarn
- yarn install --pure-lockfile
- composer install --prefer-dist --no-ansi --no-interaction --no-progress --no-scripts
- cp .env.example .env
- php artisan key:generate
- php artisan migrate:refresh --seed
- ./vendor/phpunit/phpunit/phpunit -v --coverage-text --colors=never --stderr
artifacts:
paths:
- ./storage/logs # for debugging
expire_in: 1 days
when: always
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment