Last active
May 6, 2024 06:26
-
-
Save amitavroy/40000cc4845a0b3824ed36812791b151 to your computer and use it in GitHub Desktop.
Continuous Integration with Gitlab
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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