variables:     
  SYMFONY_ENV: "test"
  APP_NAME: "cap-sup"
  
cache:
  key: "$CI_BUILD_REF_NAME"
  untracked: true
  paths:
    - vendor/

stages:
  - build
  - test
  - quality

build:
#  variables:
#    CI_DEBUG_TRACE: "true"
  stage: build  
  script:
    - /usr/local/bin/composer install --no-interaction --no-progress
    - php app/console doctrine:schema:create

test:
#  variables:
#    CI_DEBUG_TRACE: "true"
  dependencies:
    - build
  stage: test
  script:
    - phpunit -c app/ --coverage-text --colors=never --coverage-clover /applis/gitlab-runner/build-reports/$APP_NAME/tests-clover.xml --log-junit /applis/gitlab-runner/build-reports/$APP_NAME/tests-junit.xml 

sonarqube:     
  stage: quality     
  script: sonar-scanner     
  dependencies:         
    - test     
  when: always
