diff options
author | Yaco <franco@reevo.org> | 2020-06-04 11:01:00 -0300 |
---|---|---|
committer | Yaco <franco@reevo.org> | 2020-06-04 11:01:00 -0300 |
commit | fc7369835258467bf97eb64f184b93691f9a9fd5 (patch) | |
tree | daabd60089d2dd76d9f5fb416b005fbe159c799d /www/wiki/extensions/SemanticResultFormats/build |
first commit
Diffstat (limited to 'www/wiki/extensions/SemanticResultFormats/build')
3 files changed, 129 insertions, 0 deletions
diff --git a/www/wiki/extensions/SemanticResultFormats/build/travis/install-mediawiki.sh b/www/wiki/extensions/SemanticResultFormats/build/travis/install-mediawiki.sh new file mode 100644 index 00000000..ac2037ec --- /dev/null +++ b/www/wiki/extensions/SemanticResultFormats/build/travis/install-mediawiki.sh @@ -0,0 +1,25 @@ +#!/bin/bash +set -ex + +cd .. + +wget https://github.com/wikimedia/mediawiki/archive/$MW.tar.gz +tar -zxf $MW.tar.gz +mv mediawiki-$MW mw + +cd mw + +## MW 1.25 requires Psr\Logger +if [ -f composer.json ] +then + composer install +fi + +if [ "$DB" == "postgres" ] +then + psql -c 'create database its_a_mw;' -U postgres + php maintenance/install.php --dbtype $DB --dbuser postgres --dbname its_a_mw --pass nyan TravisWiki admin --scriptpath /TravisWiki +else + mysql -e 'create database its_a_mw;' + php maintenance/install.php --dbtype $DB --dbuser root --dbname its_a_mw --dbpath $(pwd) --pass nyan TravisWiki admin --scriptpath /TravisWiki +fi diff --git a/www/wiki/extensions/SemanticResultFormats/build/travis/install-semantic-result-formats.sh b/www/wiki/extensions/SemanticResultFormats/build/travis/install-semantic-result-formats.sh new file mode 100644 index 00000000..fb79ef4b --- /dev/null +++ b/www/wiki/extensions/SemanticResultFormats/build/travis/install-semantic-result-formats.sh @@ -0,0 +1,84 @@ +#!/bin/bash +set -ex + +BASE_PATH=$(pwd) +MW_INSTALL_PATH=$BASE_PATH/../mw + +function installPHPUnitWithComposer { + if [ "$PHPUNIT" != "" ] + then + composer require 'phpunit/phpunit='$PHPUNIT --update-with-dependencies + fi +} + +function installSMWWithComposer { + if [ "$SMW" != "" ] + then + composer require 'mediawiki/semantic-media-wiki='$SMW --update-with-dependencies + fi +} + +# Run Composer installation from the MW root directory +function installToMediaWikiRoot { + echo -e "Running MW root composer install build on $TRAVIS_BRANCH \n" + + cd $MW_INSTALL_PATH + + installPHPUnitWithComposer + installSMWWithComposer + + if [ "$MERMAID" != "" ] + then + composer require 'mediawiki/mermaid='$MERMAID --update-with-dependencies + fi + + composer require mediawiki/semantic-result-formats "dev-master" + + cd extensions + cd SemanticResultFormats + + # Pull request number, "false" if it's not a pull request + # After the install via composer an additional git fetch is carried out to + # update the repository to make sure that the latest code changes are + # deployed for testing + if [ "$TRAVIS_PULL_REQUEST" != "false" ] + then + git fetch origin +refs/pull/"$TRAVIS_PULL_REQUEST"/merge: + git checkout -qf FETCH_HEAD + else + git fetch origin "$TRAVIS_BRANCH" + git checkout -qf FETCH_HEAD + fi + + cd ../.. + + # Rebuild the class map for added classes during git fetch + composer dump-autoload +} + +function updateConfiguration { + + cd $MW_INSTALL_PATH + + # SMW#1732 + echo 'wfLoadExtension( "SemanticMediaWiki" );' >> LocalSettings.php + + if [ "$MERMAID" != "" ] + then + echo 'wfLoadExtension( "Mermaid" );' >> LocalSettings.php + fi + + echo 'wfLoadExtension( "SemanticResultFormats" );' >> LocalSettings.php + + echo 'error_reporting(E_ALL| E_STRICT);' >> LocalSettings.php + echo 'ini_set("display_errors", 1);' >> LocalSettings.php + echo '$wgShowExceptionDetails = true;' >> LocalSettings.php + echo '$wgDevelopmentWarnings = true;' >> LocalSettings.php + echo "putenv( 'MW_INSTALL_PATH=$(pwd)' );" >> LocalSettings.php + echo '$GLOBALS["srfgFormats"][] = "filtered";' >> LocalSettings.php + + php maintenance/update.php --skip-external-dependencies --quick +} + +installToMediaWikiRoot +updateConfiguration diff --git a/www/wiki/extensions/SemanticResultFormats/build/travis/run-tests.sh b/www/wiki/extensions/SemanticResultFormats/build/travis/run-tests.sh new file mode 100644 index 00000000..6093e162 --- /dev/null +++ b/www/wiki/extensions/SemanticResultFormats/build/travis/run-tests.sh @@ -0,0 +1,20 @@ +#! /bin/bash +set -ex + +BASE_PATH=$(pwd) +MW_INSTALL_PATH=$BASE_PATH/../mw + +function uploadCoverageReport { + wget https://scrutinizer-ci.com/ocular.phar + php ocular.phar code-coverage:upload --format=php-clover coverage.clover +} + +cd $MW_INSTALL_PATH/extensions/SemanticResultFormats + +if [ "$TYPE" == "coverage" ] +then + composer phpunit -- --coverage-clover coverage.clover + uploadCoverageReport +else + composer phpunit +fi
\ No newline at end of file |