Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

phpUnit tests workflow #725

Merged
merged 9 commits into from
May 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 0 additions & 53 deletions .github/workflows/node.yml

This file was deleted.

83 changes: 83 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Test

on:
pull_request:
push:
branches:
- main
- stable*

jobs:
unit-tests:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: [7.3, 7.4]
nextcloud-versions: ['stable21', 'stable22', 'stable23']
include:
- php-versions: 7.4
nextcloud-versions: stable24
- php-versions: 8.0
nextcloud-versions: stable24
- php-versions: 7.4
nextcloud-versions: master
- php-versions: 8.0
nextcloud-versions: master
name: Nextcloud ${{ matrix.nextcloud-versions }} php${{ matrix.php-versions }} unit tests
steps:
- name: Set up php${{ matrix.php-versions }}
uses: shivammathur/setup-php@master
with:
php-version: ${{ matrix.php-versions }}
tools: composer:v1
extensions: ctype,curl,dom,gd,iconv,intl,json,mbstring,openssl,posix,sqlite,xml,zip,gmp
coverage: xdebug
- name: Checkout Nextcloud
run: git clone https://github.com/nextcloud/server.git --recursive --depth 1 -b ${{ matrix.nextcloud-versions }} nextcloud
- name: Install Nextcloud
run: php -f nextcloud/occ maintenance:install --database-name oc_autotest --database-user oc_autotest --admin-user admin --admin-pass admin --database sqlite --database-pass=''
- name: Checkout Viewer
run: git clone https://github.com/nextcloud/viewer.git -b ${{ matrix.nextcloud-versions }} viewer
working-directory: nextcloud/apps
- name: Enable Viewer
run: php -f nextcloud/occ app:enable viewer
- name: Fix php-parser on stable20 incompatibility with phpunit 9.3+
if: ${{ matrix.nextcloud-versions == 'stable20' }}
working-directory: nextcloud/3rdparty
run: composer require nikic/php-parser:4.10
- name: Checkout Maps
uses: actions/checkout@v3
with:
path: nextcloud/apps/maps
- name: Install dependencies
working-directory: nextcloud/apps/maps
run: composer install
- name: Enable maps app
working-directory: nextcloud
run: php -f occ app:enable maps
- name: Run tests
working-directory: nextcloud/apps/maps
run: composer run test:unit
env:
XDEBUG_MODE: coverage
- name: Report coverage
uses: codecov/[email protected]
if: ${{ always() && matrix.nextcloud-versions == 'master' }}
with:
file: ./nextcloud/apps/maps/tests/clover.unit.xml
flags: unittests
fail_ci_if_error: true

frontend-unit-test:
runs-on: ubuntu-latest
name: Front-end unit tests
steps:
- uses: actions/checkout@v3
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: 12.x
- name: npm ci
run: npm ci
env:
CI: true
2 changes: 1 addition & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<screenshot>https://raw.githubusercontent.com/nextcloud/maps/master/screenshots/screenshot3.png</screenshot>
<dependencies>
<lib>exif</lib>
<nextcloud min-version="20" max-version="24"/>
<nextcloud min-version="20" max-version="25"/>
<php min-version="7.3" max-version="8.0"/>
</dependencies>
<repair-steps>
Expand Down
10 changes: 8 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
"bogdaan/open-location-code": "dev-master"
},
"require-dev": {
"christophwurst/nextcloud_testing": "^0.9.1"
}
"christophwurst/nextcloud_testing": "^0.12.4"
},
"scripts": {
"test:integration": "phpunit -c tests/phpunit.integration.xml --fail-on-warning",
"test:integration:dev": "phpunit -c tests/phpunit.integration.xml --no-coverage --order-by=defects --stop-on-defect --fail-on-warning --stop-on-error --stop-on-failure",
"test:unit": "phpunit -c tests/phpunit.unit.xml --fail-on-warning",
"test:unit:dev": "phpunit -c tests/phpunit.unit.xml --no-coverage --order-by=defects --stop-on-defect --fail-on-warning --stop-on-error --stop-on-failure"
}
}
Loading