From e1ce70d2959394d7e2d52b6871ea356ce062be0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Dagef=C3=B6rde?= Date: Mon, 29 Jan 2018 17:11:04 +0100 Subject: [PATCH] Use Travis Build Stages when configuring your build Static checks require to be tested once, not against every possible configuration. Therefore, introduce a single "prechecks" stage that does all static checking, and perform dynamic testing (behat, phpunit) against the full matrix afterwards. --- .travis.dist.yml | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/.travis.dist.yml b/.travis.dist.yml index 7a2b2b1..808a621 100644 --- a/.travis.dist.yml +++ b/.travis.dist.yml @@ -22,7 +22,7 @@ php: env: global: - - MOODLE_BRANCH=MOODLE_32_STABLE + - MOODLE_BRANCH=MOODLE_34_STABLE matrix: - DB=pgsql - DB=mysqli @@ -35,17 +35,32 @@ before_install: - composer create-project -n --no-dev --prefer-dist moodlerooms/moodle-plugin-ci ci ^2 - export PATH="$(cd ci/bin; pwd):$(cd ci/vendor/bin; pwd):$PATH" +jobs: + include: + # Prechecks against one configuration (Moodle, PHP, DB) only. + - stage: prechecks + php: 7.1 + env: DB=mysqli MOODLE_BRANCH=MOODLE_34_STABLE + install: + - moodle-plugin-ci install --no-init + script: + - moodle-plugin-ci phplint + - moodle-plugin-ci phpcpd + - moodle-plugin-ci phpmd + - moodle-plugin-ci codechecker + - moodle-plugin-ci validate + - moodle-plugin-ci savepoints + - moodle-plugin-ci mustache + - moodle-plugin-ci grunt + +# Unit tests and behat tests against full matrix (Implicit "test" stage). install: - moodle-plugin-ci install script: - - moodle-plugin-ci phplint - - moodle-plugin-ci phpcpd - - moodle-plugin-ci phpmd - - moodle-plugin-ci codechecker - - moodle-plugin-ci validate - - moodle-plugin-ci savepoints - - moodle-plugin-ci mustache - - moodle-plugin-ci grunt - moodle-plugin-ci phpunit - moodle-plugin-ci behat + +stages: +- prechecks +- test