-
Notifications
You must be signed in to change notification settings - Fork 5
169 lines (136 loc) · 4.83 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
name: CI tests (on pull requests and manually)
on:
pull_request:
branches:
- master
- develop
workflow_dispatch:
jobs:
unitAndFunctionalTests:
name: Unit and functional tests
# needed because of missing auth_plugin_caching_sha2_password in PHP 7.3
# Ubuntu 20.04 contains Mysql 8.0 that requires this as default_authentication_plugin
# another option would be to put [mysqld] default_authentication_plugin=mysql_native_password into ~./.mysql.cnf
runs-on: ubuntu-18.04
strategy:
fail-fast: false
matrix:
typo3: [ ^9.5, ^10.4 ]
php: [ '7.3', '7.4' ]
include:
- typo3: ^10.4
php: '7.4'
coverage: true
steps:
- name: Checkout Code
uses: actions/[email protected]
- name: Set up PHP version ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer:v2, php-cs-fixer
- name: Start database server
run: sudo /etc/init.d/mysql start
- name: Environment Check
run: |
php --version
composer --version
- name: Allow composer plugins
run: composer config --no-plugins allow-plugins.typo3/cms-composer-installers true
- name: Validate composer.json and composer.lock
run: composer validate
- name: Install dependencies with typo3/cms-core:${{ matrix.typo3 }}
run: |
composer require typo3/cms-core:${{ matrix.typo3 }} --no-progress
git checkout composer.json
- name: Info
run: composer info
- name: CGL
run: composer thucke:cgl
- name: PHPStan Classes
run: composer thucke:phpstan:classes
- name: Lint PHP
run: composer thucke:test:php:lint
- name: Unit Tests without coverage
run: composer thucke:test:php:unit
- name: Functional Tests without coverage
run: composer thucke:test:php:functional
env:
typo3DatabaseHost: 127.0.0.1
typo3DatabaseName: t3func
typo3DatabasePassword: root
typo3DatabaseUsername: root
TYPO3_CONEXT: Development
AcceptanceTests:
# needed because of missing auth_plugin_caching_sha2_password in PHP 7.3
# Ubuntu 20.04 contains Mysql 8.0 that requires this as default_authentication_plugin
# another option would be to put [mysqld] default_authentication_plugin=mysql_native_password into ~./.mysql.cnf
runs-on: ubuntu-18.04
strategy:
fail-fast: false
matrix:
typo3: [ ^9.5, ^10.4 ]
php: [ '7.3', '7.4' ]
steps:
- name: Checkout Code
uses: actions/[email protected]
- name: Set up PHP version ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer:v2
- name: Start database server
run: sudo /etc/init.d/mysql start
- name: Environment Check
run: |
php --version
composer --version
- name: Validate composer.json and composer.lock
run: composer validate
- name: Install dependencies with typo3/cms-core:${{ matrix.typo3 }}
run: |
composer require typo3/cms-core:${{ matrix.typo3 }} --no-progress
composer update
- name: Info
run: composer info
- name: Initialize TYPO3 environment
run: |
cp -R Tests/Acceptance/_data/typo3conf .Build/public/
cp -R Tests/Acceptance/_data/config .Build/
.Build/bin/typo3cms install:generatepackagestates
env:
TYPO3_CONEXT: Development
- name: Run PHP webserver
run: |
export APP_IP=`ip addr show eth0 | grep -Po 'inet \K[\d.]+'`
sed -i -e "s/LOCAL_DOMAIN/$APP_IP:8888/" Tests/Acceptance/_envs/github-actions.yml
php -S 0.0.0.0:8888 -t .Build/public/ &> php.log.txt &
sleep 2;
- name: Test PHP webserver and initialize TYPO3 cache
run: |
export APP_IP=`ip addr show eth0 | grep -Po 'inet \K[\d.]+'`
curl "$APP_IP:8888"
- name: Start Selenium standalone
run: |
echo $SELENIUM_JAR_PATH
java -Djava.awt.headless=true -jar $SELENIUM_JAR_PATH &
sleep 3;
- name: Acceptance Tests
run: |
composer thucke:test:php:acceptance
env:
CODECEPTION_ENV: github-actions
TYPO3_CONEXT: Development
matrix_typo3: ${{ matrix.typo3 }}
- name: Upload Codeception output
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: codeception-results
path: .Build/var/acceptance
- name: Upload PHP log
if: ${{ failure() }}
uses: actions/upload-artifact@v2
with:
name: php-log
path: php.log.txt