phug-php/compiler

View on GitHub
.travis.yml

Summary

Maintainability
Test Coverage
language: php

git:
  depth: 5

matrix:
  include:
    - php: 7.4
    - php: 7.3
      env: COVERAGE=on
      dist: trusty
    - php: 7.3
      env: STYLECHECK=on

install:
  - composer self-update
  - if [[ "$STYLECHECK" != "on" ]]; then composer require phpunit/phpunit:^7 js-phpize/js-phpize:^2 pug-php/pug-filter-coffee-script:^1 phug/split --no-update; fi;
  - if [[ "$STYLECHECK" = "on" ]]; then composer require squizlabs/php_codesniffer:~3.4.2 --no-update; fi;
  - composer install
  - |
    if [[ "$STYLECHECK" != "on" ]]; then
      mkdir -p tests/Phug && \
      vendor/bin/split copy https://github.com/phug-php/phug.git tests/Phug/ --filters=tests/Phug/Compiler,tests/Phug/Node,tests/Phug/AbstractCompilerTest.php,tests/Phug/CompilerModuleTest.php,tests/Phug/CompilerTest.php,tests/Phug/TestCompiler.php && \
      mkdir -p tests/Phug/Utils && \
      vendor/bin/split copy https://github.com/phug-php/phug.git tests/Phug/Utils/ --filters=tests/Phug/Utils/SuffixLocator.php,tests/Phug/Utils/MutedExceptionCompiler.php,tests/Phug/Utils/UnknownNode.php && \
      mkdir -p tests/templates && \
      vendor/bin/split copy https://github.com/phug-php/phug.git tests/ --filters=tests/templates;
      mkdir -p tests/composite-extensions && \
      vendor/bin/split copy https://github.com/phug-php/phug.git tests/ --filters=tests/composite-extensions;
    fi;

script:
  - if [[ "$STYLECHECK" != "on" && "$COVERAGE" != "on" ]]; then vendor/bin/phpunit; fi;
  - if [[ "$COVERAGE" = "on" ]]; then vendor/bin/phpunit --coverage-text --coverage-clover=coverage.xml; fi;
  - if [[ "$STYLECHECK" = "on" ]]; then vendor/bin/phpcs --ignore=*.js Compiler AbstractCompilerModule.php Compiler.php CompilerEvent.php CompilerException.php CompilerInterface.php CompilerModuleInterface.php; fi;

notifications:
  slack: phug:nzXFnxhU14RWK2EQSDL0u08z

addons:
  code_climate:
    repo_token: 4c27d7efe84c820a751151e32eb3850b5238eadf335953720f2e1da7a5633144