# Perform an upgrade test too.
- DB=pgsql TASK=UPGRADE
- # Run a check for unbuilt files with Grunt.
- - DB=none TASK=GRUNT
-
matrix:
# Enable fast finish.
# This will fail the build if a single job fails (except those in allow_failures).
# It will not stop the jobs from running.
fast_finish: true
+ include:
+ # Run grunt/npm install on lowest supported npm version
+ - php: 7
+ env: DB=none TASK=GRUNT NVM_VERSION='4'
+ # Run grunt/npm install on highest version ('node' is an alias for the latest node.js version.)
+ - php: 7
+ env: DB=none TASK=GRUNT NVM_VERSION='node'
+
exclude:
# MySQL - it's just too slow.
# Exclude it on all versions except for 7.0
- env: DB=mysqli TASK=PHPUNIT
php: 5.6
- # One grunt execution is enough.
- - env: DB=none TASK=GRUNT
- php: 5.6
-
# Moodle 2.7 is not compatible with PHP 7 for the upgrade test.
- env: DB=pgsql TASK=UPGRADE
php: 7.0
# Disable xdebug. We aren't generating code coverage, and it has a huge impact upon test performance.
- rm /home/travis/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini
- # Set the encrypted GITHUB_TOKEN if it's available to raise the API limit.
- - if [ -n "$GITHUB_APITOKEN" ]; then composer config github-oauth.github.com $GITHUB_APITOKEN; fi
- - echo 'auth.json' >> .git/info/exclude
+ - >
+ if [ "$TASK" = 'PHPUNIT' ];
+ then
+ if [ -n "$GITHUB_APITOKEN" ]; then
+ composer config github-oauth.github.com $GITHUB_APITOKEN;
+ echo 'auth.json' >> .git/info/exclude
+ fi
+
+ # Install composer dependencies.
+ # We need --no-interaction in case we hit API limits for composer. This causes it to fall back to a standard clone.
+ # Typically it should be able to use the Composer cache if any other job has already completed before we started here.
+ travis_retry composer install --prefer-dist --no-interaction;
+ fi
- # Install composer dependencies.
- # We need --no-interaction in case we hit API limits for composer. This causes it to fall back to a standard clone.
- # Typically it should be able to use the Composer cache if any other job has already completed before we started here.
- - travis_retry composer install --prefer-dist --no-interaction
+ - >
+ if [ "$TASK" = 'GRUNT' ];
+ then
+ nvm install $NVM_VERSION ;
+ nvm use $NVM_VERSION ;
+ fi
before_script:
- >
- >
if [ "$TASK" = 'GRUNT' ];
then
- npm install ;
- npm install -g grunt ;
- grunt ;
+ npm install --no-spin;
+ npm install --no-spin -g grunt ;
fi
########################################################################
- >
if [ "$TASK" = 'GRUNT' ];
then
+ grunt ;
# Add all files to the git index and then run diff --cached to see all changes.
# This ensures that we get the status of all files, including new files.
git add . ;