mirror of
https://github.com/moodle/moodle.git
synced 2025-08-07 01:46:45 +02:00
Merge branch 'MDL-70265_39' of https://github.com/stronk7/moodle into MOODLE_39_STABLE
This commit is contained in:
commit
ea4e0ae3cb
1 changed files with 29 additions and 71 deletions
100
.travis.yml
100
.travis.yml
|
@ -16,31 +16,9 @@ services:
|
||||||
- mysql
|
- mysql
|
||||||
- docker
|
- docker
|
||||||
|
|
||||||
php:
|
|
||||||
# We only run the highest and lowest supported versions to reduce the load on travis-ci.org.
|
|
||||||
- 7.4
|
|
||||||
- 7.2
|
|
||||||
|
|
||||||
addons:
|
addons:
|
||||||
postgresql: "9.6"
|
postgresql: "9.6"
|
||||||
|
|
||||||
env:
|
|
||||||
# Although we want to run these jobs and see failures as quickly as possible, we also want to get the slowest job to
|
|
||||||
# start first so that the total run time is not too high.
|
|
||||||
#
|
|
||||||
# We only run MySQL on PHP 7.2, so run that first.
|
|
||||||
# CI Tests should be second-highest in priority as these only take <= 60 seconds to run under normal circumstances.
|
|
||||||
# Postgres is significantly is pretty reasonable in its run-time.
|
|
||||||
|
|
||||||
# Run CI Tests without running PHPUnit.
|
|
||||||
- DB=none TASK=CITEST
|
|
||||||
|
|
||||||
# Run unit tests on Postgres
|
|
||||||
- DB=pgsql TASK=PHPUNIT
|
|
||||||
|
|
||||||
# Perform an upgrade test too.
|
|
||||||
- DB=pgsql TASK=UPGRADE
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# Enable fast finish.
|
# Enable fast finish.
|
||||||
# This will fail the build if a single job fails (except those in allow_failures).
|
# This will fail the build if a single job fails (except those in allow_failures).
|
||||||
|
@ -48,12 +26,35 @@ jobs:
|
||||||
fast_finish: true
|
fast_finish: true
|
||||||
|
|
||||||
include:
|
include:
|
||||||
# Run mysql only on highest - it's just too slow
|
# First all the lowest php ones (7.2)
|
||||||
- php: 7.4
|
- php: 7.2
|
||||||
|
env: DB=none TASK=CITEST
|
||||||
|
- php: 7.2
|
||||||
|
env: DB=none TASK=GRUNT NVM_VERSION='lts/carbon'
|
||||||
|
|
||||||
|
- if: env(MOODLE_DATABASE) = "pgsql" OR env(MOODLE_DATABASE) = "all" OR env(MOODLE_DATABASE) IS NOT present
|
||||||
|
php: 7.2
|
||||||
|
env: DB=pgsql TASK=PHPUNIT
|
||||||
|
|
||||||
|
- if: env(MOODLE_DATABASE) = "mysqli" OR env(MOODLE_DATABASE) = "all"
|
||||||
|
php: 7.2
|
||||||
|
env: DB=mysqli TASK=PHPUNIT
|
||||||
|
|
||||||
|
# Then, conditionally, all the highest php ones (7.4)
|
||||||
|
- if: env(MOODLE_PHP) = "all"
|
||||||
|
php: 7.4
|
||||||
|
env: DB=none TASK=CITEST
|
||||||
|
- if: env(MOODLE_PHP) = "all"
|
||||||
|
php: 7.4
|
||||||
|
env: DB=none TASK=GRUNT NVM_VERSION='lts/carbon'
|
||||||
|
|
||||||
|
- if: env(MOODLE_PHP) = "all" AND (env(MOODLE_DATABASE) = "pgsql" OR env(MOODLE_DATABASE) = "all" OR env(MOODLE_DATABASE) IS NOT present)
|
||||||
|
php: 7.4
|
||||||
|
env: DB=pgsql TASK=PHPUNIT
|
||||||
|
|
||||||
|
- if: env(MOODLE_PHP) = "all" AND (env(MOODLE_DATABASE) = "mysqli" OR env(MOODLE_DATABASE) = "all")
|
||||||
|
php: 7.4
|
||||||
env: DB=mysqli TASK=PHPUNIT
|
env: DB=mysqli TASK=PHPUNIT
|
||||||
# Run grunt/npm install on highest version too ('node' is an alias for the latest node.js version.)
|
|
||||||
- php: 7.4
|
|
||||||
env: DB=none TASK=GRUNT NVM_VERSION='lts/carbon'
|
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
directories:
|
directories:
|
||||||
|
@ -113,7 +114,7 @@ install:
|
||||||
before_script:
|
before_script:
|
||||||
- phpenv config-rm xdebug.ini
|
- phpenv config-rm xdebug.ini
|
||||||
- >
|
- >
|
||||||
if [ "$TASK" = 'PHPUNIT' -o "$TASK" = 'UPGRADE' ];
|
if [ "$TASK" = 'PHPUNIT' ];
|
||||||
then
|
then
|
||||||
# Copy generic configuration in place.
|
# Copy generic configuration in place.
|
||||||
cp config-dist.php config.php ;
|
cp config-dist.php config.php ;
|
||||||
|
@ -224,32 +225,6 @@ before_script:
|
||||||
export phpcmd=`which php`;
|
export phpcmd=`which php`;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
########################################################################
|
|
||||||
# Upgrade test
|
|
||||||
########################################################################
|
|
||||||
- >
|
|
||||||
if [ "$TASK" = 'UPGRADE' ];
|
|
||||||
then
|
|
||||||
# We need the official upstream.
|
|
||||||
git remote add upstream https://github.com/moodle/moodle.git;
|
|
||||||
|
|
||||||
# Checkout 30 STABLE branch (the first version compatible with PHP 7.x)
|
|
||||||
git fetch upstream MOODLE_30_STABLE;
|
|
||||||
git checkout MOODLE_30_STABLE;
|
|
||||||
|
|
||||||
# Perform the upgrade
|
|
||||||
php admin/cli/install_database.php --agree-license --adminpass=Password --adminemail=admin@example.com --fullname="Upgrade test" --shortname=Upgrade;
|
|
||||||
|
|
||||||
# Return to the previous commit
|
|
||||||
git checkout -;
|
|
||||||
|
|
||||||
# Perform the upgrade
|
|
||||||
php admin/cli/upgrade.php --non-interactive --allow-unstable ;
|
|
||||||
|
|
||||||
# The local_ci repository can be used to check upgrade savepoints.
|
|
||||||
git clone https://github.com/moodlehq/moodle-local_ci.git local/ci ;
|
|
||||||
fi
|
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- >
|
- >
|
||||||
if [ "$TASK" = 'PHPUNIT' ];
|
if [ "$TASK" = 'PHPUNIT' ];
|
||||||
|
@ -275,23 +250,6 @@ script:
|
||||||
git diff --cached --exit-code ;
|
git diff --cached --exit-code ;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
########################################################################
|
|
||||||
# Upgrade test
|
|
||||||
########################################################################
|
|
||||||
- >
|
|
||||||
if [ "$TASK" = 'UPGRADE' ];
|
|
||||||
then
|
|
||||||
cp local/ci/check_upgrade_savepoints/check_upgrade_savepoints.php ./check_upgrade_savepoints.php
|
|
||||||
result=`php check_upgrade_savepoints.php`;
|
|
||||||
# Check if there are problems
|
|
||||||
count=`echo "$result" | grep -P "ERROR|WARN" | wc -l` ;
|
|
||||||
if (($count > 0));
|
|
||||||
then
|
|
||||||
echo "$result"
|
|
||||||
exit 1 ;
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
after_script:
|
after_script:
|
||||||
- >
|
- >
|
||||||
if [ "$TASK" = 'PHPUNIT' ];
|
if [ "$TASK" = 'PHPUNIT' ];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue