Skip to content

Instantly share code, notes, and snippets.

@Asetss
Created May 14, 2019 07:05
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 Asetss/5f103ea06458b4d8b800001d5de9201a to your computer and use it in GitHub Desktop.
Save Asetss/5f103ea06458b4d8b800001d5de9201a to your computer and use it in GitHub Desktop.
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: registry.gitlab.com/aknosis/laravel-ci-example:latest
script:
- composer install --prefer-dist --no-ansi --no-interaction --no-progress --no-scripts
- cp .env.example .env
- php artisan command:ReloadCI
- php artisan key:generate
- php artisan jwt:secret
- php artisan serve &
- ./vendor/phpunit/phpunit/phpunit -v --colors=never
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