osb/.gitlab-ci.yml

74 lines
2.0 KiB
YAML
Raw Normal View History

2017-12-05 00:26:53 +00:00
# This file is a template, and might need editing before it works on your project.
# Official framework image. Look for the different tagged releases at:
# https://hub.docker.com/r/library/php
2020-12-02 10:55:15 +00:00
image: registry.leenooks.net/leenooks/php:7.4-fpm-plus
2017-12-05 00:26:53 +00:00
# Pick zero or more services to be used on all builds.
# Only needed when using a docker container to run your tests in.
# Check out: http://docs.gitlab.com/ce/ci/docker/using_docker_images.html#what-is-a-service
services:
2020-12-02 10:55:15 +00:00
- mariadb:10.5
2017-12-05 00:26:53 +00:00
variables:
MYSQL_DATABASE: testing
MYSQL_ROOT_PASSWORD: test
MYSQL_USER: test
MYSQL_PASSWORD: test
2017-12-05 00:26:53 +00:00
# This folder is cached between builds
# http://docs.gitlab.com/ce/ci/yaml/README.html#cache
cache:
paths:
- vendor/
# This is a basic example for a gem or script which doesn't use
# services such as redis or postgres
before_script:
# Add gnupg & zip
- apt-get update -yqq && apt-get install gnupg2 unzip -yqq
2018-04-10 11:55:09 +00:00
2017-12-05 00:26:53 +00:00
# Install dependencies
2020-01-22 13:04:45 +00:00
- apt-get install git autoconf -yqq
2017-12-05 00:26:53 +00:00
# Install & enable Xdebug for code coverage reports
- pecl install xdebug
- docker-php-ext-enable xdebug
# Install Composer and project dependencies.
2020-01-30 11:28:54 +00:00
- mkdir -p /root/.composer
- if [ -n "$GITHUB_TOKEN" ]; then cat $GITHUB_TOKEN |base64 -d > /root/.composer/auth.json ; fi
2020-01-22 13:12:17 +00:00
- composer install
2017-12-05 00:26:53 +00:00
# Copy over testing configuration.
# Don't forget to set the database config in .env.testing correctly
# DB_HOST=mysql
# DB_DATABASE=project_name
# DB_USERNAME=root
# DB_PASSWORD=secret
# Generate an application key. Re-cache.
2018-07-10 03:42:17 +00:00
- php artisan key:generate --env=testing
- php artisan config:cache --env=testing
2017-12-05 00:26:53 +00:00
# Run database migrations.
- php artisan migrate
# Run database seed
- php artisan db:seed
test:
tags:
- php
only:
- master
script:
# run laravel tests
- php vendor/bin/phpunit --coverage-text --colors=never
# run frontend tests
# if you have any task for testing frontend
# set it in your package.json script
# comment this out if you don't have a frontend test
# npm test