workshop-gitlab-acceptance/.gitlab-ci.yml

46 lines
1.2 KiB
YAML

stages:
- setup
- test
setup:composer:
image: composer:latest
stage: setup
script:
- mkdir -p .composer/cache
- COMPOSER_CACHE_DIR=.composer/cache composer install --no-progress --no-ansi --no-interaction -o
cache:
key: composer-cache
paths:
- .composer/cache
artifacts:
expire_in: 30 mins
paths:
- app
- web
- vendor
test:acceptance:
image: php:7.2-alpine
stage: test
services:
- mysql:5.7
- mailhog/mailhog:v1.0.0
- selenium/standalone-chrome
variables:
MYSQL_ROOT_PASSWORD: "dev"
MYSQL_DATABASE: "dev"
MYSQL_USER: "dev"
MYSQL_PASSWORD: "dev"
before_script:
- docker-php-ext-install pdo pdo_mysql mysqli
- export LOCAL_IP=$(ip a | grep inet | sed -n 2p | xargs | cut -d" " -f2 | cut -d"/" -f1)
- export TESTING_DOMAIN="$LOCAL_IP:8080"
- export TYPO3_CONTEXT=Testing/Acceptance
- php -S "$TESTING_DOMAIN" -t web &
script:
- ./vendor/bin/codecept run --env=gitlab-ci
artifacts:
when: on_failure
expire_in: 10 mins
paths:
- tests/_output/