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

58 lines
2.1 KiB
YAML

stages:
- lint
- setup
- test
lint:php7.2:
image: php:7.2-alpine
stage: lint
before_script:
- apk --no-cache add parallel
script:
- find localPackages/ -name \*.php | parallel --gnu php -d display_errors=stderr -l {} > /dev/null \;
lint:xml:
image: alpine:3.7
stage: lint
before_script:
- apk --no-cache add libxml2-utils
- wget https://raw.githubusercontent.com/symfony/translation/v4.1.1/Resources/schemas/xliff-core-1.2-strict.xsd
script:
- xmllint --schema xliff-core-1.2-strict.xsd --noout $(find localPackages -name '*.xlf')
lint:composer:
image: composer:latest
stage: lint
script:
- composer validate --no-check-publish --no-check-all
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:
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