.travis.yml
language: php
services: mysql
php:
- '7.3'
env:
global:
- CC_TEST_REPORTER_ID=61a416728f1c3aa827c71f2e30b8fae5db873d092659773b86eea151ca7bd2c5
before_install:
- nvm install
- composer self-update
- openssl aes-256-cbc -K $encrypted_1b7a23229d96_key -iv $encrypted_1b7a23229d96_iv -in build/ci/travis.tar.enc -out build/ci/travis.tar -d
- tar xvf build/ci/travis.tar
- mv travis ~/.ssh/id_rsa
- mv travis.pub ~/.ssh/id_rsa.pub
- chmod 600 ~/.ssh/id_rsa.pub
- chmod 600 ~/.ssh/id_rsa
- echo "Host *.wmflabs" > ~/.ssh/config
- echo " User communitytech" > ~/.ssh/config
- ssh-keyscan -t rsa tools-dev.wmflabs.org >> ~/.ssh/known_hosts
- sudo apt-get install expect
- ./build/ci/ssh-tunnel.sh
#- ./build/phpdoc-install.php # Disabled until we need PhpDocumentor, see below.
- echo "extension = apcu.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini # Install ext-apcu
- npm -g install npm # Upgrade npm so we can use the ci install command.
install:
- cp app/config/parameters-travis.yml.dist app/config/parameters.yml
- composer install
- npm ci
- php bin/console doctrine:database:create --env=test --no-interaction --quiet
- php bin/console doctrine:migrations:migrate --env=test --no-interaction --quiet
before_script:
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
- ./cc-test-reporter before-build
script:
# Compile assets, and make sure nothing's changed in Git.
- node_modules/.bin/encore production
- git status | grep "nothing to commit, working tree clean"
- composer lint
#- composer docs # Disabled for now, until PhpDocumentor 3 supports checkstyle again.
- ./vendor/bin/phpunit --coverage-clover ./clover.xml tests
after_script:
- ps -ef | grep communitytech@tools-dev.wmflabs.org | awk 'NR==1{print $3}' | xargs kill -9
- ./cc-test-reporter after-build --coverage-input-type clover --exit-code $TRAVIS_TEST_RESULT
branches:
only:
- master