Skip to content
This repository has been archived by the owner on Jan 16, 2020. It is now read-only.

Add travis template #16

Merged
merged 5 commits into from
Aug 2, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions template/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
sudo: false

language: php

cache:
directories:
- $HOME/.composer/cache
- $HOME/.local
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we need here vendor and zf-mkdoc-theme?


env:
global:
- COMPOSER_ARGS="--no-interaction"
- COVERAGE_DEPS="satooshi/php-coveralls"
- LEGACY_DEPS="phpunit/phpunit"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about other variables (for docs deploy)?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is for new packages, I think we can ignore the LEGACY_DEPS situation entirely.


matrix:
include:
- php: 5.6
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For new packages, we only need 7.1 and nightly; we can remove the 5.6 and 7.0 targets (though you'll have to move the TEST_COVERAGE env stuff to the 7.1 locked env).

env:
- DEPS=lowest
- php: 5.6
env:
- DEPS=locked
- TEST_COVERAGE=true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about:

- DEPLOY_DOCS="$(if [[ $TRAVIS_BRANCH == 'master' && $TRAVIS_PULL_REQUEST == 'false' ]]; then echo -n 'true' ; else echo -n 'false' ; fi)"

Copy link
Member

@froschdesign froschdesign Jul 13, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct, this is missing!

- php: 5.6
env:
- DEPS=latest
- php: 7
env:
- DEPS=lowest
- php: 7
env:
- DEPS=locked
- CS_CHECK=true
- php: 7
env:
- DEPS=latest
- php: 7.1
env:
- DEPS=lowest
- php: 7.1
env:
- DEPS=locked
- php: 7.1
env:
- DEPS=latest
- php: nightly
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Last change, I promise! However, I discovered today that we can now use the alias 7.2! They'll be updating it to track the betas, RCs, and then stable releases. I tested it on the zend-psr7bridge package, and it works brilliantly!

env:
- DEPS=lowest
- php: nightly
env:
- DEPS=locked
- php: nightly
env:
- DEPS=latest
allow_failures:
- php: nightly

before_install:
- if [[ $TEST_COVERAGE != 'true' ]]; then phpenv config-rm xdebug.ini || return 0 ; fi
- travis_retry composer self-update

install:
- travis_retry composer install $COMPOSER_ARGS
- if [[ $TRAVIS_PHP_VERSION =~ ^5.6 ]]; then travis_retry composer update $COMPOSER_ARGS --with-dependencies $LEGACY_DEPS ; fi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be removed when you remove the 5.6 targets.

- if [[ $DEPS == 'latest' ]]; then travis_retry composer update $COMPOSER_ARGS ; fi
- if [[ $DEPS == 'lowest' ]]; then travis_retry composer update --prefer-lowest --prefer-stable $COMPOSER_ARGS ; fi
- if [[ $TEST_COVERAGE == 'true' ]]; then travis_retry composer require --dev $COMPOSER_ARGS $COVERAGE_DEPS ; fi
- stty cols 120
- export COLUMNS=120
- composer show
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would go here with:

- COLUMNS=120 composer show

instead of two above lines

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need both the stty cols 120 and export COLUMNS lines?

  • If only the stty command works, remove the export line.
  • If the export works, remove the stty line, and combine the export and the composer show lines as @webimpress suggests.


script:
- if [[ $TEST_COVERAGE == 'true' ]]; then composer test-coverage ; else composer test ; fi
- if [[ $CS_CHECK == 'true' ]]; then composer cs-check ; fi

after_script:
- if [[ $TEST_COVERAGE == 'true' ]]; then composer upload-coverage ; fi

notifications:
email: false