174 lines (155 loc) · 5.2 KB
/
ci.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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
name: CI Build
on:
workflow_dispatch:
push:
branches:
- master
- issue*
jobs:
staticanalyses:
runs-on: ubuntu-20.04
steps:
- name: Checkout carddavclient
uses: actions/checkout@v2
- name: Set up CI environment
uses: ./.github/actions/setup
with:
php-version: '8.0'
- name: Check code style compliance with PSR12
run: make stylecheck
- name: Check code compatibility with minimum supported PHP version
run: make phpcompatcheck
- name: Run psalm static analysis
run: make psalmanalysis
unittests:
strategy:
fail-fast: false
matrix:
php-version: ['7.3', '7.4', '8.0', '8.1']
runs-on: ubuntu-20.04
env:
XDEBUG_MODE: coverage
steps:
- name: Checkout carddavclient
uses: actions/checkout@v2
- name: Set up CI environment
uses: ./.github/actions/setup
with:
php-version: '8.0'
- name: Run unit tests
run: make unittests
- name: Upload unit test coverage reports to codecov.io
uses: codecov/codecov-action@v1
with:
file: testreports/unit/clover.xml
flags: unittests
name: Carddavclient unit test coverage
fail_ci_if_error: false
interop-nextcloud:
strategy:
fail-fast: false
matrix:
nextcloud-version: ['21', '22', '23']
runs-on: ubuntu-20.04
env:
XDEBUG_MODE: coverage
CARDDAVCLIENT_INTEROP_SRV: Nextcloud
services:
nextcloud:
image: nextcloud:${{ matrix.nextcloud-version }}
options: >-
--name nextcloud
ports:
- 8080:80
steps:
- name: Checkout carddavclient
uses: actions/checkout@v2
- name: Set up CI environment
uses: ./.github/actions/setup
with:
php-version: '8.0'
- name: Setup Nextcloud
run: |
sudo docker exec --user www-data nextcloud php occ maintenance:install --admin-user=ncadm --admin-pass=ncadmPassw0rd
sudo docker exec --user www-data nextcloud php occ app:install contacts
sudo docker exec --user www-data nextcloud php occ app:disable contactsinteraction
- name: Run interop tests
run: make tests-interop
- name: Upload interop-nextcloud test coverage reports to codecov.io
uses: codecov/codecov-action@v1
with:
file: testreports/interop/clover.xml
flags: interop
name: Carddavclient nextcloud interoperability test coverage
fail_ci_if_error: false
interop-radicale:
runs-on: ubuntu-20.04
env:
XDEBUG_MODE: coverage
CARDDAVCLIENT_INTEROP_SRV: Radicale
steps:
- name: Checkout carddavclient
uses: actions/checkout@v2
- name: Start Radicale
run: |
mkdir -p ${{ github.workspace }}/.github/configs/radicale/data
sudo docker run --name radicale -d -p 5232:5232 -v ${{ github.workspace }}/.github/configs/radicale/data:/data -v ${{ github.workspace }}/.github/configs/radicale/config:/config:ro tomsquest/docker-radicale:next
- name: Set up CI environment
uses: ./.github/actions/setup
with:
php-version: '8.0'
- name: Create Radicale Addressbooks
run: |
.github/scripts/createabook.sh "http://127.0.0.1:5232/citest/book1/" 'Book 1' 'First addressbook' citest citest
.github/scripts/createabook.sh "http://127.0.0.1:5232/citest/book2/" 'Book 2' 'Second addressbook' citest citest
- name: Run interop tests
run: make tests-interop
- name: Upload interop-radicale test coverage reports to codecov.io
uses: codecov/codecov-action@v1
with:
file: testreports/interop/clover.xml
flags: interop
name: Carddavclient radicale interoperability test coverage
fail_ci_if_error: false
interop-davical:
runs-on: ubuntu-20.04
env:
XDEBUG_MODE: coverage
CARDDAVCLIENT_INTEROP_SRV: Davical
PGHOST: localhost
PGUSER: postgres
services:
postgres:
image: postgres:12-alpine
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
--name postgres
ports:
- 5432:5432
steps:
- name: Checkout carddavclient
uses: actions/checkout@v2
- name: Set up CI environment
uses: ./.github/actions/setup
with:
php-version: '7.4'
- name: Setup Davical
run: |
.github/scripts/deployDavical.sh
- name: Create Davical Addressbooks
run: |
.github/scripts/createabook.sh "http://davical.localdomain/davical/caldav.php/admin/book1/" 'Test addressbook' 'Davical test addresses' admin admin
- name: Run interop tests
run: make tests-interop
- name: Upload interop-radicale test coverage reports to codecov.io
uses: codecov/codecov-action@v1
with:
file: testreports/interop/clover.xml
flags: interop
name: Carddavclient radicale interoperability test coverage
fail_ci_if_error: false