chill-bundles/.gitlab-ci.yml

55 lines
1.7 KiB
YAML

.test_definition: &test_definition
services:
- chill/database:latest
before_script:
- composer config github-oauth.github.com $GITHUB_TOKEN
- php -d memory_limit=-1 /usr/local/bin/composer install --no-interaction
- cp Resources/test/Fixtures/App/app/config/parameters.gitlab-ci.yml Resources/test/Fixtures/App/app/config/parameters.yml
- php Resources/test/Fixtures/App/app/console --env=test cache:warmup
- php Resources/test/Fixtures/App/app/console doctrine:migrations:migrate --env=test --no-interaction
- php Resources/test/Fixtures/App/app/console doctrine:fixtures:load --env=test --no-interaction
stages:
- test
- build-doc
- deploy-doc
test:php-7.2:
stage: test
image: chill/ci-image:php-7.2
<<: *test_definition
script: php vendor/bin/phpunit
# deploy documentation
api-doc-build:
stage: build-doc
environment: api-doc
image: chill/ci-image:php-7.2
before_script:
- mkdir api-doc
script: apigen generate --destination api-doc/$CI_BUILD_REF_NAME/$CI_PROJECT_NAME
artifacts:
paths:
- "api-doc/"
name: api
expire_in: '2h'
only:
- master
- tags
api-doc-deploy:
stage: deploy-doc
image: pallet/swiftclient:latest
before_script:
# test that CONTAINER_API variable is set
- if [ -z ${CONTAINER_API+x} ]; then echo "Please set CONTAINER_API variable"; exit -1; fi
# go to api-doc to have and url with PROJECT/BUILD
- cd api-doc
# upload, and keep files during 1 year
script: "swift upload --header \"X-Delete-After: 31536000\" $CONTAINER_API $CI_BUILD_REF_NAME/$CI_PROJECT_NAME"
only:
- master
- tags