From 2c318af1c5c08320a6b08031786c13796b9d6033 Mon Sep 17 00:00:00 2001 From: sualko Date: Thu, 18 Jun 2020 11:21:26 +0200 Subject: [PATCH] ci: run unit tests --- .travis.yml | 79 +++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 74 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2753cdc..becd16a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,15 +1,84 @@ dist: bionic +language: php +php: + - 7.2 + - 7.3 + - 7.4 + +services: + - mysql + - postgresql + +env: + global: + - CORE_BRANCH=stable19 + - DB=mysql + - LINT=false + +matrix: + include: + - php: 7.2 + env: "DB=sqlite" + - php: 7.3 + env: "DB=sqlite" + - php: 7.4 + env: "DB=sqlite" + - php: 7.3 + env: "DB=pgsql" + - php: 7.4 + env: "DB=pgsql" + - php: 7.3 + env: "LINT=true" + - php: 7.3 + env: "CORE_BRANCH=stable18" + - php: 7.4 + env: "CORE_BRANCH=master" + - php: nightly + env: "DB=sqlite" + fast_finish: true + allow_failures: + - php: nightly + - php: 7.4 + env: "CORE_BRANCH=master" cache: yarn: true directories: - node_modules + - "$HOME/.composer/cache/files" + - "$HOME/.npm" -before_script: phpenv global 7.3 +#before_script: phpenv global 7.3 + +before_install: + - php --info + + # Set up DB + - 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 + + - composer self-update + - yarn install + - yarn composer:install:dev + - cd .. + - git clone https://github.com/nextcloud/server.git --recursive --depth 1 -b $CORE_BRANCH core + - mv cloud_bbb core/apps/bbb + +before_script: + # Set up core + - php -f core/occ maintenance:install --database-name oc_autotest --database-user oc_autotest --admin-user admin --admin-pass admin --database $DB --database-pass='' + + # Set up app + - php -f core/occ app:enable bbb + # Enable app twice to check occ errors of registered commands + - php -f core/occ app:enable bbb + + - cd core/apps/bbb script: - php -v - - yarn install - - yarn composer:install:dev - - yarn lint - - yarn commitlint-travis + - yarn test + - if [[ "$LINT" = 'true' ]]; then yarn lint; fi + - if [[ "$LINT" = 'true' ]]; then yarn commitlint-travis; fi