-
Notifications
You must be signed in to change notification settings - Fork 5
112 lines (108 loc) · 4.39 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: Test
on: pull_request
permissions:
contents: read
jobs:
unit-tests:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['8.2']
nextcloud-versions: ['master']
include:
- php-versions: 8.0
nextcloud-versions: stable25
- php-versions: 8.2
nextcloud-versions: stable26
name: Nextcloud ${{ matrix.nextcloud-versions }} php${{ matrix.php-versions }} unit tests
steps:
- name: Set up php${{ matrix.php-versions }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: ctype,curl,dom,gd,iconv,intl,json,mbstring,openssl,posix,sqlite,xml,zip,gmp
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout Nextcloud
run: git clone https://github.com/nextcloud/server.git --recursive --depth 1 -b ${{ matrix.nextcloud-versions }} nextcloud
- name: Patch version check for nightly PHP
if: ${{ matrix.php-versions == '8.2' }}
run: echo "<?php" > nextcloud/lib/versioncheck.php
- 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 sentry
uses: actions/checkout@v4
with:
path: nextcloud/apps/sentry
- name: Install dependencies
working-directory: nextcloud/apps/sentry
run: composer install
- name: Run tests
working-directory: nextcloud/apps/sentry
run: composer run test:unit
env:
XDEBUG_MODE: off
integration-tests:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['8.0']
nextcloud-versions: ['master']
db: ['sqlite']
include:
- php-versions: 8.0
nextcloud-versions: stable24
db: 'sqlite'
- php-versions: 8.1
nextcloud-versions: stable25
db: 'sqlite'
- php-versions: 8.2
nextcloud-versions: stable26
db: 'sqlite'
- php-versions: 8.2
nextcloud-versions: stable27
db: 'sqlite'
name: php${{ matrix.php-versions }}-${{ matrix.db }} integration tests
steps:
- name: Set up php${{ matrix.php-versions }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: ctype,curl,dom,gd,iconv,intl,json,mbstring,openssl,posix,sqlite,xml,zip,gmp
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout Nextcloud
run: git clone https://github.com/nextcloud/server.git --recursive --depth 1 -b ${{ matrix.nextcloud-versions }} nextcloud
- name: Patch version check for nightly PHP
if: ${{ matrix.php-versions == '8.2' }}
run: echo "<?php" > nextcloud/lib/versioncheck.php
- name: Install Nextcloud
run: php -f nextcloud/occ maintenance:install --database-host 127.0.0.1 --database-name nextcloud --database-user nextcloud --database-pass nextcloud --admin-user admin --admin-pass admin --database ${{ matrix.db }}
- name: Checkout sentry
uses: actions/checkout@v4
with:
path: nextcloud/apps/sentry
- name: Install dependencies
working-directory: nextcloud/apps/sentry
run: composer install
- name: Install sentry
run: php -f nextcloud/occ app:enable sentry
- name: Configure Nextcloud for testing
run: php -f nextcloud/occ config:system:set debug --type bool --value true
- name: Run tests
working-directory: nextcloud/apps/sentry
run: composer run test:integration
env:
XDEBUG_MODE: off
summary:
runs-on: ubuntu-latest
needs:
- unit-tests
- integration-tests
if: always()
name: test-summary
steps:
- name: Unit test status
run: if ${{ needs.unit-tests.result != 'success' && needs.unit-tests.result != 'skipped' }}; then exit 1; fi
- name: Integration test status
run: if ${{ needs.integration-tests.result != 'success' && needs.integration-tests.result != 'skipped' }}; then exit 1; fi