passman/.travis.yml

105 lines
3.5 KiB
YAML
Raw Permalink Normal View History

2016-09-09 23:36:35 +08:00
language: php
php:
- 7.1
- 7.2
2016-10-08 02:28:01 +08:00
env:
global:
2016-12-19 23:01:53 +08:00
- CORE_BRANCH=master
2016-10-08 02:28:01 +08:00
- APP_NAME=passman
2016-10-10 00:40:33 +08:00
- SERVER_FOLDER=server
- CLOUD=nextcloud
- SERVER=nextcloud/travis_ci/master
2016-10-08 04:03:23 +08:00
matrix:
- DB=mysql
- DB=sqlite
#fixes mysqlerrors
dist: precise
2016-10-08 02:28:01 +08:00
branches:
only:
- master
- fix_layout_for_14
services:
# enable a display for running JavaScript tests
- xvfb
# enable a display for running JavaScript tests
#- export DISPLAY=:99.0
# - sh -e /etc/init.d/xvfb start
# - if [[ "$DB" == 'mysql' ]]; then sudo apt-get -y install mariadb-server; fi
- if [[ "$DB" == 'mysql' ]]; then sudo apt-get -y install mariadb-server; fi
2016-10-10 00:40:33 +08:00
# - wget https://raw.githubusercontent.com/nextcloud/travis_ci/master/before_install.sh
- wget https://raw.githubusercontent.com/$SERVER/before_install.sh
- . ./before_install.sh "$APP_NAME" "$CORE_BRANCH" "$DB"
2016-10-08 02:28:01 +08:00
# Add some output debugging information
2016-10-10 00:40:33 +08:00
- cd ../${SERVER_FOLDER}
2016-10-08 02:28:01 +08:00
- ./occ check
- ./occ status
- ./occ app:list
2016-10-10 00:40:33 +08:00
- ./occ app:enable $APP_NAME
2017-10-29 18:34:38 +08:00
- nvm install 7.0
2016-09-09 23:36:35 +08:00
- npm install -g npm@latest
2016-10-08 07:57:08 +08:00
- sh -c "if [ '$JSTESTS' = '1' ]; then npm install grunt-cli -g; fi"
2016-10-08 02:55:17 +08:00
2016-10-08 02:11:49 +08:00
#
2016-09-09 23:36:35 +08:00
before_script:
2016-10-08 02:11:49 +08:00
# - if [[ "$DB" == 'pgsql' ]]; then createuser -U travis -s oc_autotest; fi
# - if [[ "$DB" == 'mysql' ]]; then mysql -u root -e 'create database oc_autotest;'; fi
# - if [[ "$DB" == 'mysql' ]]; then mysql -u root -e "CREATE USER 'oc_autotest'@'localhost' IDENTIFIED BY '';"; fi
# - if [[ "$DB" == 'mysql' ]]; then mysql -u root -e "grant all on oc_autotest.* to 'oc_autotest'@'localhost';"; fi
2016-10-10 00:40:33 +08:00
2016-10-08 03:18:35 +08:00
- php -S localhost:8080 &
2016-10-08 02:28:01 +08:00
- cd apps/$APP_NAME/
2017-10-29 18:21:03 +08:00
- sh -c "if [ '$CLOUD' = 'nextcloud' ]; then cp /home/travis/build/nextcloud/server/composer.json .; fi;"
2016-10-08 02:55:17 +08:00
- mkdir -p build
2017-02-05 23:18:06 +08:00
- curl -sSL https://phar.phpunit.de/phpunit-5.7.phar -o build/phpunit.phar
2017-10-29 01:12:59 +08:00
#- sh -c "if [ '$JSTESTS' != '1' ]; then composer require codacy/coverage -vvv; fi"
2017-02-05 23:18:06 +08:00
- sh -c "if [ '$JSTESTS' != '1' ]; then wget https://scrutinizer-ci.com/ocular.phar; fi"
2016-10-08 07:57:08 +08:00
- sh -c "if [ '$JSTESTS' = '1' ]; then npm install; fi"
2016-10-08 02:11:49 +08:00
# - ./occ maintenance:install --database-name oc_autotest --database-user oc_autotest --admin-user admin --admin-pass admin --database $DB --database-pass=''
2016-10-08 03:08:58 +08:00
2016-09-09 23:36:35 +08:00
script:
2016-10-08 04:03:23 +08:00
# Test the app
2017-02-05 23:18:06 +08:00
- sh -c "if [ '$JSTESTS' != '1' ]; then find . -name \*.php -exec php -l \"{}\" \;; fi"
2016-10-08 04:03:23 +08:00
- cd ../../
# - sh -c "if [ '$JSTESTS' != '1' ]; then ./occ app:check-code $APP_NAME -c private -c strong-comparison; fi"
# - sh -c "if [ '$JSTESTS' != '1' ]; then ./occ app:check-code $APP_NAME -c deprecation; fi"
2016-10-08 04:03:23 +08:00
- cd apps/$APP_NAME/
2017-02-05 23:18:06 +08:00
- sh -c "if [ '$JSTESTS' != '1' ]; then php build/phpunit.phar -v -c phpunit.xml --coverage-clover=coverage.clover --coverage-php=phpunit; fi"
2017-01-04 05:03:28 +08:00
2016-10-08 04:03:23 +08:00
# Create coverage report
2017-10-29 01:12:59 +08:00
#- sh -c "if [ '$JSTESTS' != '1' ]; then php vendor/bin/codacycoverage -v clover coverage.clover; fi"
2017-02-05 23:18:06 +08:00
- sh -c "if [ '$JSTESTS' != '1' ]; then php ocular.phar code-coverage:upload --access-token="$SCRUTINIZER_TOKEN" --format=php-clover coverage.clover; fi"
2017-01-04 05:03:28 +08:00
2016-10-08 07:57:08 +08:00
- sh -c "if [ '$JSTESTS' = '1' ]; then grunt jshint; fi"
2016-10-17 17:28:48 +08:00
- sh -c "if [ '$JSTESTS' = '1' ]; then grunt karma; fi"
2016-10-08 04:03:23 +08:00
2016-10-08 03:05:48 +08:00
2016-10-08 02:37:29 +08:00
#after_failure:
# - cat ../../data/owncloud.log
2016-09-09 23:36:35 +08:00
addons:
2016-10-08 04:03:23 +08:00
firefox: "latest"
matrix:
include:
2018-12-22 19:25:19 +08:00
- php: 7.1
2017-02-05 23:18:06 +08:00
env: DB=mysql;
2018-12-22 19:25:19 +08:00
- php: 7.1
env: DB=mysql;JSTESTS=1;
- php: 7.2
env: DB=mysql;
- php: 7.2
env: DB=mysql;JSTESTS=1;
2016-10-08 04:03:23 +08:00
allow_failures:
2016-12-19 23:01:53 +08:00
- env: DB=sqlite;CODECHECK=2