-
-
Notifications
You must be signed in to change notification settings - Fork 88
77 lines (74 loc) · 3 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Test
on:
pull_request:
push:
branches:
- main
- stable*
jobs:
unit-tests:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: [8.1, 8.2]
nextcloud-versions: ['stable26','stable27']
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: 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
if: ${{ always() && matrix.php-versions != 8.1 }}
working-directory: nextcloud/apps/maps
run: composer run test:unit
env:
XDEBUG_MODE: coverage
- name: Run tests
if: ${{ always() && matrix.php-versions == 8.1 }}
working-directory: nextcloud/apps/maps
run: composer run test:unit
env:
XDEBUG_MODE: off
- name: Report coverage
uses: codecov/[email protected]
if: ${{ always() && matrix.nextcloud-versions == 'master' && matrix.php-versions != 8.1}}
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