diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml new file mode 100644 index 00000000..77095717 --- /dev/null +++ b/.github/workflows/phpunit.yml @@ -0,0 +1,42 @@ +name: PHPUnit + +on: + pull_request: + push: + branches: + - master + - stable* + +jobs: + php: + runs-on: ubuntu-latest + + strategy: + matrix: + php-versions: ['7.2', '7.3', '7.4'] + server-versions: ['master'] + + name: php${{ matrix.php-versions }} on ${{ matrix.server-versions }} + steps: + - name: Checkout server + uses: actions/checkout@v2 + with: + repository: nextcloud/server + ref: ${{ matrix.server-versions }} + path: server + - name: Checkout current + uses: actions/checkout@v2 + with: + path: apps/notestutorial + - name: Set up php${{ matrix.php-versions }} + uses: shivammathur/setup-php@v1 + with: + php-version: ${{ matrix.php-versions }} + tools: phpunit + coverage: none + - name: Install dependencies + run: composer install + - name: List directories + run: | + pwd + ls -la \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 03be06ab..00000000 --- a/.travis.yml +++ /dev/null @@ -1,65 +0,0 @@ -sudo: false -dist: trusty -language: php -php: - - 7.2 -env: - global: - - CORE_BRANCH=master - - FRONTEND=no - - DB=sqlite - -matrix: - include: - - env: FRONTEND=yes - - php: 7.2 - env: DB=sqlite - - php: 7.2 - env: DB=mysql - - php: 7.3 - env: DB=mysql - - php: 7.4 - env: DB=mysql - - php: 7.3 - env: DB=pgsql - fast_finish: true - -before_install: - # enable a display for running JavaScript tests - - export DISPLAY=:99.0 - - sh -e /etc/init.d/xvfb start - - nvm install 8 - - npm install -g npm@latest - - make composer - # install core - - cd ../ - - git clone https://github.com/nextcloud/server.git --recursive --depth 1 -b $CORE_BRANCH nextcloud - - mv "$TRAVIS_BUILD_DIR" nextcloud/apps/notestutorial - -before_script: - - 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 - - cd nextcloud - - mkdir data - - ./occ maintenance:install --database-name oc_autotest --database-user oc_autotest --admin-user admin --admin-pass admin --database $DB --database-pass='' - - ./occ app:enable notestutorial - - php -S localhost:8080 & - - cd apps/notestutorial - -script: - - if [[ "FRONTEND" == 'no' ]]; then make test; fi - - if [[ "FRONTEND" == 'yes' ]]; then make; fi - - -after_failure: - - cat ../../data/nextcloud.log - -addons: - firefox: 'latest' - mariadb: '10.1' - -services: - - postgresql - - mariadb