-
Notifications
You must be signed in to change notification settings - Fork 39
183 lines (149 loc) · 4.75 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
175
176
177
178
179
180
181
182
183
on:
push:
branches:
- '*'
- '!master'
name: Continuous Integration
jobs:
php-lint:
name: PHP linter
runs-on: ubuntu-latest
strategy:
matrix:
php-version:
- 7.4
- 8.0
steps:
- name: Configure PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
- name: Checkout
uses: actions/checkout@v1
- name: Run PHP lint
run: |
echo "${{ matrix.exclude-pattern }}"
find *.php Classes/ Configuration/ Tests/ -name '*.php' ${{ matrix.exclude-pattern }}
find *.php Classes/ Configuration/ Tests/ -name '*.php' ${{ matrix.exclude-pattern }} -print0 | xargs -0 -n 1 -P 4 php -l
typoscript-lint:
name: TypoScript linter
runs-on: ubuntu-latest
strategy:
matrix:
php-version:
- 7.4
- 8.0
steps:
- name: Configure PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: none
tools: composer:${{ matrix.composer-version }}
- name: Checkout
uses: actions/checkout@v1
- name: "Cache dependencies installed with composer"
uses: actions/cache@v1
with:
path: ~/.composer/cache
key: php${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: |
php${{ matrix.php-version }}-composer-
- name: Install Composer dependencies
run: composer install --no-progress
- name: Run TypoScript lint
run: composer ci:ts:lint
php-code-sniffer:
name: PHP Code Sniffer
runs-on: ubuntu-latest
strategy:
matrix:
php-version:
- 7.4
- 8.0
steps:
- name: Configure PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: none
tools: composer:${{ matrix.composer-version }}
- name: Checkout
uses: actions/checkout@v1
- name: "Cache dependencies installed with composer"
uses: actions/cache@v1
with:
path: ~/.composer/cache
key: php${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: |
php${{ matrix.php-version }}-composer-
- name: Install Composer dependencies
run: composer install --no-progress
- name: Run PHP Code Sniffer
run: composer ci:php:sniff
unit-tests:
name: Unit tests
runs-on: ubuntu-latest
strategy:
matrix:
composer-version:
- v2
typo3-version:
- "^11.4"
composer-dependencies:
- highest
php-version:
- 7.4
- 8.0
include:
- typo3-version: "^11.4"
database-image: mariadb:latest
services:
mysql:
image: ${{ matrix.database-image }}
env:
MYSQL_ALLOW_EMPTY_PASSWORD: false
MYSQL_DATABASE: typo3
MYSQL_ROOT_PASSWORD: password
MYSQL_USER: user
ports:
- 3306
steps:
- name: Configure PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: fileinfo, filter, gd, hash, intl, json, mbstring, mysqli, openssl, pcre, session, SPL, xml, zip, zlib
coverage: none
tools: composer:${{ matrix.composer-version }}
- name: Checkout
uses: actions/checkout@v1
- name: "Cache dependencies installed with composer"
uses: actions/cache@v1
with:
path: ~/.composer/cache
key: php${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: |
php${{ matrix.php-version }}-composer-
- name: Install TYPO3 Core
env:
TYPO3: ${{ matrix.typo3-version }}
run: |
composer --version
composer require typo3/minimal:"${{ matrix.typo3-version }}"
composer show
- name: Install highest dependencies with composer
if: matrix.composer-dependencies == 'highest'
run: |
composer update --no-ansi --no-interaction --no-progress --no-suggest
composer show
- name: Run unit tests
run: composer ci:tests:unit
# - name: Run functional tests
# env:
# typo3DatabaseHost: 127.0.0.1
# typo3DatabasePort: ${{ job.services.mysql.ports['3306'] }}
# typo3DatabaseName: typo3
# typo3DatabaseUsername: root
# typo3DatabasePassword: password
# run: composer ci:tests:functional