symphonycms/symphony-2

View on GitHub
.travis.yml

Summary

Maintainability
Test Coverage
language: php

php:
  - 7.4
  - 7.3
  - 7.2
  - 7.1
  - 7.0
  - 5.6
  - nightly
  #- hhvm # until phpunit supports it

matrix:
  fast_finish: true
  allow_failures:
    - php: 7.4
    - php: nightly
    - php: hhvm
    - php: 5.6

# we need sudo to install apache
sudo: required

# services we need to start
services:
  - mysql

before_install:
  # update apt
  - travis_retry sudo apt-get update
  # use node 12
  - nvm install 12
  - nvm use 12

install:
  # install apache
  - travis_retry sudo apt-get install apache2 libapache2-mod-fastcgi
  # add composer to PATH
  - export PATH="$HOME/.composer/vendor/bin:./vendor/bin:$PATH"
  # install php dependancies
  - travis_retry composer install -o --no-interaction
  # install node dependancies
  - npm install
  # install phpstan
  - if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.1" ]] || [[ ${TRAVIS_PHP_VERSION:0:3} == "7.2" ]]; then travis_retry composer require --dev phpstan/phpstan; fi;

before_script:
  # create database
  - travis_retry mysql -e "CREATE DATABASE symphony_test CHARACTER SET = 'utf8mb4' COLLATE = 'utf8mb4_unicode_ci';"
  # install and configure apache
  - ./tests/ci/travis-configure-apache.sh

script:
  # run unit tests
  - npm test
  # clean up unit tests
  - php tests/shutdown.php
  # install symphony
  - ./tests/ci/travis-install-symphony.sh
  # run integration tests
  - npm run integration
  # run phpstan
  - if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.1" ]] || [[ ${TRAVIS_PHP_VERSION:0:3} == "7.2" ]]; then npm run stan; fi;

after_success:
  # merge code coverage reports
  - phpcov merge . --clover coverage.xml
  # send it to codecov
  - bash <(curl -s https://codecov.io/bash)

cache:
  npm: true
  composer: true
  directories:
    - $HOME/.composer/cache
    - node_modules
    - vendor