From d5f87b7910d443b86be38e32a3ab714231ea1ff6 Mon Sep 17 00:00:00 2001 From: Jonas Sulzer Date: Wed, 2 Jan 2019 16:15:02 +0100 Subject: [PATCH] .travis.yml and .drone.yml to make automatic CI tests work Signed-off-by: Jonas Sulzer --- .drone.yml | 45 +++++++++++++++++++++++++++++++++++++++++ .travis.yml | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 103 insertions(+) create mode 100644 .drone.yml create mode 100644 .travis.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..5042e6f --- /dev/null +++ b/.drone.yml @@ -0,0 +1,45 @@ +clone: + git: + image: plugins/git + depth: 1 + +pipeline: + check-app-compatbility: + image: nextcloudci/php7.0:php7.0-19 + environment: + - APP_NAME=user_external + - CORE_BRANCH=master + - DB=sqlite + commands: + # Pre-setup steps + - wget https://raw.githubusercontent.com/nextcloud/travis_ci/master/before_install.sh + - bash ./before_install.sh $APP_NAME $CORE_BRANCH $DB + - cd ../server + + # Code checker + - ./occ app:check-code $APP_NAME -c strong-comparison + - ./occ app:check-code $APP_NAME -c deprecation + - cd apps/$APP_NAME/ + when: + matrix: + TESTS: check-app-compatbility + + signed-off-check: + image: nextcloudci/php7.0:php7.0-19 + environment: + - APP_NAME=user_external + - CORE_BRANCH=master + - DB=sqlite + commands: + - wget https://raw.githubusercontent.com/nextcloud/travis_ci/master/before_install.sh + - bash ./before_install.sh $APP_NAME $CORE_BRANCH $DB + - cd ../server + - php ./build/signed-off-checker.php + when: + matrix: + TESTS: signed-off-check + +matrix: + include: + - TESTS: signed-off-check + - TESTS: check-app-compatbility diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..e18d5ec --- /dev/null +++ b/.travis.yml @@ -0,0 +1,58 @@ +language: php +php: + - 7.1 + - 7.2 + - 7.3 + +env: + global: + - APP_NAME=user_external + - PHP_COVERAGE=FALSE + matrix: + - DB=sqlite SERVER=nextcloud/travis_ci/master SERVER_BRANCH=master + - DB=sqlite SERVER=nextcloud/travis_ci/master SERVER_BRANCH=stable15 + - DB=sqlite SERVER=nextcloud/travis_ci/master SERVER_BRANCH=stable14 + - DB=mysql SERVER=nextcloud/travis_ci/master SERVER_BRANCH=master PHP_COVERAGE=TRUE + - DB=mysql SERVER=nextcloud/travis_ci/master SERVER_BRANCH=stable15 + - DB=mysql SERVER=nextcloud/travis_ci/master SERVER_BRANCH=stable14 + - DB=pgsql SERVER=nextcloud/travis_ci/master SERVER_BRANCH=master + - DB=pgsql SERVER=nextcloud/travis_ci/master SERVER_BRANCH=stable15 + - DB=pgsql SERVER=nextcloud/travis_ci/master SERVER_BRANCH=stable14 + +matrix: + fast_finish: true + +branches: + only: + - master + - /^stable\d+(\.\d+)?$/ + +before_install: + - sudo apt-get -qq update + - sudo apt-get install -y libxml2-utils + - composer install + - wget https://raw.githubusercontent.com/$SERVER/before_install.sh + - . ./before_install.sh "$APP_NAME" "$SERVER_BRANCH" "$DB" + - cd ../core || cd ../server + - php occ app:enable $APP_NAME + +before_script: + # Test lint + - cd apps/$APP_NAME + - find . -name \*.php -exec php -l "{}" \; + +script: + - ant test + + # Check info.xml schema validity + - wget https://apps.nextcloud.com/schema/apps/info.xsd + - xmllint appinfo/info.xml --schema info.xsd --noout + - rm info.xsd + + # Run phpunit tests + - cd tests + - phpunit --configuration phpunit.xml + + # Create coverage report + - sh -c "if [ '$PHP_COVERAGE' != 'FALSE' ]; then wget https://scrutinizer-ci.com/ocular.phar; fi" + - sh -c "if [ '$PHP_COVERAGE' != 'FALSE' ]; then php ocular.phar code-coverage:upload --format=php-clover clover.xml; fi"