Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only split the monorepo if the whole build is successful #2

Merged
merged 2 commits into from
Aug 18, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 12 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ matrix:
- php: 7.1
- php: 7.2

# Split the monorepo
- php: 7.2
env: MONOREPO_SPLIT=true

# Generate the coverage with the latest PHP version
- php: 7.2
env: COVERAGE='--exclude-group contao3'
Expand All @@ -40,6 +36,18 @@ matrix:
env: COMPOSER_FLAGS='--prefer-lowest --prefer-stable'
fast_finish: true

jobs:
include:
# Split the monorepo
- stage: split
if: 'type = push AND branch =~ /^(master|\d+\.\d+)$/'
php: 7.2
install:
# Project dependencies don’t need to be installed for the split script
- rm composer.json
- composer require contao/monorepo-tools:dev-master --no-interaction
script: vendor/bin/monorepo-tools split $TRAVIS_BRANCH --cache-dir $HOME/.monorepo-split-cache

before_install:
- if [[ ! $COVERAGE ]]; then phpenv config-rm xdebug.ini || true; fi
- echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
Expand All @@ -58,7 +66,6 @@ script:
- if [[ $COVERAGE ]]; then php vendor/bin/phpunit -c installation-bundle $COVERAGE --coverage-clover build/logs/installation-bundle.xml; else php vendor/bin/phpunit -c installation-bundle; fi
- if [[ $COVERAGE ]]; then php vendor/bin/phpunit -c manager-bundle $COVERAGE --coverage-clover build/logs/manager-bundle.xml; else php vendor/bin/phpunit -c manager-bundle; fi
- if [[ $COVERAGE ]]; then php vendor/bin/phpunit -c news-bundle $COVERAGE --coverage-clover build/logs/news-bundle.xml; else php vendor/bin/phpunit -c news-bundle; fi
- if [[ $MONOREPO_SPLIT == true && $TRAVIS_EVENT_TYPE == "push" ]]; then composer require contao/monorepo-tools:dev-master; vendor/bin/monorepo-tools split $TRAVIS_BRANCH --cache-dir $HOME/.monorepo-split-cache; fi

after_script:
- if [[ $COVERAGE ]]; then php vendor/bin/php-coveralls -x build/logs/calendar-bundle.xml -x build/logs/core-bundle.xml -x build/logs/faq-bundle.xml -x build/logs/installation-bundle.xml -x build/logs/manager-bundle.xml -x build/logs/news-bundle.xml; fi