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

39 lines
1.5 KiB
YAML

stages:
- setup
- test
setup:composer:
image: composer:latest
stage: setup
script:
- mkdir -p .composer/cache
- composer config -g github-oauth.github.com $GITHUB_ACCESS_TOKEN
- COMPOSER_CACHE_DIR=.composer/cache composer install --no-progress --no-ansi --no-interaction -o
cache:
key: composer-cache
paths:
- .composer/cache
artifacts:
expire_in: 1 hour
paths:
- app
- public
- vendor
test:acceptance:
image: php:7.2-alpine
stage: test
dependencies:
- setup:composer
before_script:
- apk --no-cache add mysql
- cp public/index.php app
- cp public/typo3/index.php app/typo3/index.php
- cp public/typo3/install.php app/typo3/install.php
- mysql -u root -proot -e 'CREATE DATABASE workshopgitlabtesting CHARACTER SET utf8 COLLATE utf8_general_ci;'
- mysql -u root -proot -e "CREATE USER 'testing'@'localhost' IDENTIFIED BY 'testing';"
- mysql -u root -proot -e "GRANT ALL PRIVILEGES ON workshopgitlabtesting.* TO 'testing'@'localhost';"
- mysql -u root -proot -e 'GRANT ALL PRIVILEGES ON `workshopgitlabtesting\_%`.* TO testing@localhost;'
- TYPO3_PATH_ROOT=$(pwd)/app/typo3temp/var/tests/acceptance TYPO3_PATH_APP=$(pwd)/app/typo3temp/var/tests/acceptance php -S 127.0.0.1:8080 -t app/typo3temp/var/tests/acceptance &
script:
- ./vendor/bin/codecept run