diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..f9366fac --- /dev/null +++ b/.editorconfig @@ -0,0 +1,8 @@ +root = true + +[*] +indent_style = space +indent_size = 4 +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true diff --git a/.travis.yml b/.travis.yml index b3f7f17b..7d7a4a1c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,24 +1,20 @@ -dist: trusty language: php -sudo: required before_install: -- openssl aes-256-cbc -K $encrypted_ab8f92ccaef0_key -iv $encrypted_ab8f92ccaef0_iv - -in scripts/sudo-bot/keys.tar.enc -out scripts/sudo-bot/keys.tar -d -- tar -C scripts/sudo-bot/ -xvf scripts/sudo-bot/keys.tar + - openssl aes-256-cbc -K $encrypted_ab8f92ccaef0_key -iv $encrypted_ab8f92ccaef0_iv -in scripts/sudo-bot/keys.tar.enc -out scripts/sudo-bot/keys.tar -d + - tar -C scripts/sudo-bot/ -xvf scripts/sudo-bot/keys.tar before_script: -- "./scripts/ci/install-reporters.sh" -- "./scripts/ci/install.sh" + - './scripts/ci/install-reporters.sh' + - './scripts/ci/install.sh' script: -- ./scripts/ci/ci-$CI_TYPE.sh + - ./scripts/ci/ci-$CI_TYPE.sh install: -- flags="--ansi --prefer-dist --no-interaction --optimize-autoloader --no-suggest - --no-progress" -- composer install $flags + - flags="--ansi --prefer-dist --no-interaction --optimize-autoloader --no-suggest --no-progress" + - composer install $flags after_success: -- bash <(curl -s https://codecov.io/bash) + - if [ "$CI_TYPE" != "cron" ]; then bash <(curl -s https://codecov.io/bash); else echo "skipped codecov"; fi after_script: -- "./codacy-coverage.phar clover build/logs/clover.xml" + - if [ "$CI_TYPE" != "cron" ]; then ./codacy-coverage.phar clover build/logs/clover.xml; else echo "skipped codacy"; fi stages: - name: tests if: NOT type = cron @@ -29,40 +25,43 @@ jobs: - stage: tests php: '7.2' env: CI_TYPE=phpstan - name: "PHPSTAN - PHP 7.2" + name: 'PHPSTAN - PHP 7.2' - stage: tests php: '7.2' env: CI_TYPE=phpcs - name: "PHPCS - PHP 7.1" + name: 'PHPCS - PHP 7.1' - stage: tests php: '7.1' env: CI_TYPE=phpunit - name: "PHPUNIT - PHP 7.1" + name: 'PHPUNIT - PHP 7.1' - stage: tests php: '7.2' env: CI_TYPE=phpunit - name: "PHPUNIT - PHP 7.2" + name: 'PHPUNIT - PHP 7.2' - stage: tests os: osx language: generic php: '7.2' env: CI_TYPE=phpunit - name: "PHPUNIT - PHP 7.2" + name: 'PHPUNIT - PHP 7.2' before_install: - - "./scripts/ci/install-osx.sh" + - './scripts/ci/install-osx.sh' - stage: robot php: '7.2' env: CI_TYPE=cron - name: "Create a pull-request to update data" + name: 'Create a pull-request to update data' cache: + ccache: true apt: true directories: - - "$HOME/.composer/cache/" - - "$HOME/.cache/bower" - - "$HOME/.npm" - - "$HOME/.cache/ci" - - "/var/cache/apt" - - "~/Library/Caches/Homebrew" + - $HOME/.composer/cache/ + - $HOME/.cache/bower + - $HOME/.npm + - $HOME/.cache/ci + - /var/cache/apt + - $HOME/Library/Caches/Homebrew +before_cache: + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew cleanup; fi addons: apt: update: false diff --git a/scripts/ci/install-osx.sh b/scripts/ci/install-osx.sh index fed4897b..36f495d3 100755 --- a/scripts/ci/install-osx.sh +++ b/scripts/ci/install-osx.sh @@ -1,4 +1,8 @@ #!/bin/bash - +mkdir ~/.homebrew_logs +export HOMEBREW_LOGS="~/.homebrew_logs" +export HOMEBREW_TEMP="/tmp" +export HOMEBREW_INSTALL_BADGE="🌻" +brew update brew install openldap libiconv php@7.2 composer sed -i -e 's/^memory_limit = .*/memory_limit = -1/' /usr/local/etc/php/7.2/php.ini