-
-
Notifications
You must be signed in to change notification settings - Fork 9
185 lines (166 loc) · 5.44 KB
/
tests.yaml
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
175
176
177
178
179
180
181
182
183
184
185
name: Tests
on:
push:
branches:
- main
- 'renovate/**'
pull_request:
branches:
- main
jobs:
tests:
name: Tests (PHP ${{ matrix.php-version }}, TYPO3 ${{ matrix.typo3-version }} & ${{ matrix.dependencies }} dependencies)
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-version: ["8.1", "8.2", "8.3", "8.4"]
typo3-version: ["12.4", "13.4"]
dependencies: ["highest", "lowest"]
exclude:
- php-version: "8.1"
typo3-version: "13.4"
# Enforce PHPUnit ^11.2 for TYPO3 13.4 & lowest dependencies
# since it adds support for doubling readonly classes (SiteFinder in our case)
include:
- php-version: "8.2"
typo3-version: "13.4"
dependencies: "lowest"
composer-options: "--with=phpunit/phpunit:^11.2"
- php-version: "8.3"
typo3-version: "13.4"
dependencies: "lowest"
composer-options: "--with=phpunit/phpunit:^11.2"
# Enforce eliashaeussler/valinor-xml ^1.0.3 for PHP 8.4 & lowest dependencies
# since 1.0.2 has broken PHP 8.4 support
- php-version: "8.4"
typo3-version: "12.4"
dependencies: "lowest"
composer-options: "--with=eliashaeussler/valinor-xml:^1.0.3"
- php-version: "8.4"
typo3-version: "13.4"
dependencies: "lowest"
composer-options: "--with=phpunit/phpunit:^11.2 --with=eliashaeussler/valinor-xml:^1.0.3"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
# Prepare environment
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: composer:v2
coverage: none
# Setup DDEV
- name: Setup DDEV
uses: ddev/github-action-setup-ddev@v1
with:
autostart: false
- name: Configure and start DDEV
run: |
ddev config --project-type=typo3 --php-version=${{ matrix.php-version }} --webimage-extra-packages=
ddev start
# Install dependencies
- name: Install Composer dependencies
uses: ramsey/composer-install@v3
with:
dependency-versions: ${{ matrix.dependencies }}
composer-options: --with=typo3/cms-core:"^${{ matrix.typo3-version }}" ${{ matrix.composer-options }}
# Run tests
- name: Run acceptance tests
uses: nick-fields/retry@v3
with:
max_attempts: 3
retry_on: error
timeout_minutes: 10
command: ddev composer test:acceptance
new_command_on_retry: ddev composer test:acceptance -- -g failed
- name: Run functional and unit tests
run: |
ddev composer test:functional
ddev composer test:unit
# Save acceptance reports
- uses: actions/upload-artifact@v4
with:
name: acceptance-reports-${{ matrix.php-version }}-${{ matrix.typo3-version }}-${{ matrix.dependencies }}
path: .Build/log/acceptance-reports
if: failure()
coverage:
name: Test coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
# Prepare environment
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.4
tools: composer:v2
coverage: none
# Setup DDEV
- name: Setup DDEV
uses: ddev/github-action-setup-ddev@v1
with:
autostart: false
- name: Configure and start DDEV
run: |
ddev config --project-type=typo3 --xdebug-enabled=true
ddev start
# Install dependencies
- name: Install Composer dependencies
uses: ramsey/composer-install@v3
# Run tests
- name: Run tests
uses: nick-fields/retry@v3
with:
max_attempts: 3
retry_on: error
timeout_minutes: 10
command: ddev composer test:coverage
# Upload artifact
- name: Fix coverage path
working-directory: .Build/coverage
run: sed -i 's#/var/www/html#${{ github.workspace }}#g' clover.xml
- name: Upload coverage artifact
uses: actions/upload-artifact@v4
with:
name: coverage
path: .Build/coverage/clover.xml
retention-days: 7
# Save acceptance reports
- uses: actions/upload-artifact@v4
with:
name: acceptance-reports-coverage
path: .Build/log/acceptance-reports
if: failure()
coverage-report:
name: Report test coverage
runs-on: ubuntu-latest
needs: coverage
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
# Download artifact
- name: Download coverage artifact
id: download
uses: actions/download-artifact@v4
with:
name: coverage
# CodeClimate
- name: CodeClimate report
uses: paambaati/[email protected]
if: env.CC_TEST_REPORTER_ID
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
coverageLocations: |
${{ steps.download.outputs.download-path }}/clover.xml:clover
# Coveralls
- name: Coveralls report
uses: coverallsapp/github-action@v2
with:
file: ${{ steps.download.outputs.download-path }}/clover.xml