Skip to content

Commit e3bf316

Browse files
authored
Merge pull request #12138 from nextcloud/backport/12125/stable5.6
[stable5.6] ci: less coverage runs
2 parents 41f5eac + f6d63d2 commit e3bf316

File tree

1 file changed

+17
-22
lines changed

1 file changed

+17
-22
lines changed

.github/workflows/test.yml

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,23 @@ jobs:
1717
php-versions: ['8.2', '8.3']
1818
nextcloud-versions: ['master', 'stable31']
1919
include:
20+
- php-versions: '8.4'
21+
nextcloud-versions: 'master'
22+
coverage: true
2023
- php-versions: '8.1'
2124
nextcloud-versions: 'stable32'
2225
- php-versions: '8.4'
2326
nextcloud-versions: 'stable32'
2427
- php-versions: '8.5'
2528
nextcloud-versions: 'master'
26-
name: Nextcloud ${{ matrix.nextcloud-versions }} php${{ matrix.php-versions }} unit tests
29+
name: Nextcloud ${{ matrix.nextcloud-versions }} php${{ matrix.php-versions }} unit tests ${{ matrix.coverage && '(coverage)' || ''}}
2730
steps:
2831
- name: Set up Nextcloud env
2932
uses: ChristophWurst/setup-nextcloud@fc0790385c175d97e88a7cb0933490de6e990374 # v0.3.2
3033
with:
3134
nextcloud-version: ${{ matrix.nextcloud-versions }}
3235
php-version: ${{ matrix.php-versions }}
33-
php-coverage: 'xdebug'
36+
php-coverage: ${{ matrix.coverage && 'xdebug' || 'none' }}
3437
patch-php-version-check: ${{ matrix.php-versions == '8.5' }}
3538
node-version: 'false'
3639
install: true
@@ -45,18 +48,11 @@ jobs:
4548
- name: Run tests
4649
working-directory: nextcloud/apps/mail
4750
run: composer run test:unit
48-
if: ${{ matrix.php-versions == '8.3' }}
4951
env:
50-
XDEBUG_MODE: coverage
51-
- name: Run tests
52-
working-directory: nextcloud/apps/mail
53-
run: composer run test:unit
54-
if: ${{ matrix.php-versions != '8.3' }}
55-
env:
56-
XDEBUG_MODE: off
52+
XDEBUG_MODE: ${{ matrix.coverage && 'coverage' || 'off' }}
5753
- name: Report coverage
5854
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1
59-
if: ${{ always() && matrix.php-versions == '8.3' }}
55+
if: ${{ !cancelled() && matrix.coverage }}
6056
with:
6157
token: ${{ secrets.CODECOV_TOKEN }}
6258
working-directory: nextcloud/apps/mail
@@ -74,6 +70,11 @@ jobs:
7470
db: ['sqlite', 'mysql', 'pgsql']
7571
cache: ['nocache']
7672
include:
73+
- php-versions: 8.4
74+
nextcloud-versions: 'master'
75+
db: 'mysql'
76+
cache: 'nocache'
77+
coverage: true
7778
- php-versions: 8.1
7879
nextcloud-versions: 'stable31'
7980
db: 'sqlite'
@@ -90,11 +91,12 @@ jobs:
9091
nextcloud-versions: 'stable32'
9192
db: 'mysql'
9293
cache: 'redis'
94+
coverage: true
9395
- php-versions: 8.5
9496
nextcloud-versions: 'master'
9597
db: 'mysql'
9698
cache: 'redis'
97-
name: ${{ matrix.nextcloud-versions }} w/ php${{ matrix.php-versions }}-${{ matrix.db }}-${{ matrix.cache }} integration tests
99+
name: ${{ matrix.nextcloud-versions }} w/ php${{ matrix.php-versions }}-${{ matrix.db }}-${{ matrix.cache }} integration tests ${{ matrix.coverage && '(coverage)' || ''}}
98100
services:
99101
mail-service:
100102
image: ghcr.io/christophwurst/docker-imap-devel:latest
@@ -149,7 +151,7 @@ jobs:
149151
with:
150152
nextcloud-version: ${{ matrix.nextcloud-versions }}
151153
php-version: ${{ matrix.php-versions }}
152-
php-coverage: 'xdebug'
154+
php-coverage: ${{ matrix.coverage && 'xdebug' || 'none' }}
153155
patch-php-version-check: ${{ matrix.php-versions == '8.5' }}
154156
install: true
155157
database: ${{ matrix.db }}
@@ -184,16 +186,9 @@ jobs:
184186
echo "SET GLOBAL log_output = 'table';" | mysql -h 127.0.0.1 -u root -pmy-secret-pw
185187
- name: Run tests
186188
working-directory: nextcloud/apps/mail
187-
if: ${{ matrix.db == 'mysql' }}
188-
run: composer run test:integration
189-
env:
190-
XDEBUG_MODE: coverage
191-
- name: Run tests
192-
working-directory: nextcloud/apps/mail
193-
if: ${{ matrix.db != 'mysql' }}
194189
run: composer run test:integration
195190
env:
196-
XDEBUG_MODE: off
191+
XDEBUG_MODE: ${{ matrix.coverage && 'coverage' || 'off' }}
197192
- name: Read slow queries
198193
if: ${{ always() }}
199194
run: echo "SELECT * FROM mysql.slow_log WHERE sql_text LIKE '%oc_mail%' AND sql_text NOT LIKE '%information_schema%'" | mysql -h 127.0.0.1 -u root -pmy-secret-pw
@@ -202,7 +197,7 @@ jobs:
202197
run: cat nextcloud/data/mail-*-*-imap.log
203198
- name: Report coverage
204199
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1
205-
if: ${{ always() && matrix.db == 'mysql' }}
200+
if: ${{ !cancelled() && matrix.coverage }}
206201
with:
207202
token: ${{ secrets.CODECOV_TOKEN }}
208203
working-directory: nextcloud/apps/mail

0 commit comments

Comments
 (0)