-
Notifications
You must be signed in to change notification settings - Fork 4
95 lines (79 loc) · 3.65 KB
/
tests.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
name: Tests
on: [ push, pull_request ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
typo3: [ ^11.5 ]
php: [ '7.4', '8.0', '8.1', '8.2', '8.3' ]
mysql: [ '5.7' ]
steps:
- name: Set up MySQL ${{ matrix.mysql }}
uses: mirromutth/[email protected]
with:
mysql version: ${{ matrix.mysql }}
mysql root password: 'root'
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 10
- name: Set up PHP Version ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer:v2
- name: Environment Check
run: |
php --version
composer --version
- name: Validate composer.json and composer.lock
run: composer validate
- name: Install dependencies with nimut/typo3-complete:${{ matrix.typo3 }}
run: |
composer require --dev nimut/typo3-complete:${{ matrix.typo3 }} --no-progress
git checkout composer.json
ln -nfs .Build/vendor/typo3/cms/typo3 typo3
- name: Lint PHP
run: find . -name \*.php ! -path "./.Build/*" ! -path "./scripts/*" ! -path "./typo3_src/*" | parallel --gnu php -d display_errors=stderr -l {} > /dev/null \;
- name: Unit Tests without coverage
if: matrix.typo3 != '^11.5' || matrix.php != '8.3'
run: |
export "UNIT_XML"=.Build/vendor/typo3/testing-framework/Resources/Core/Build/UnitTests.xml
.Build/bin/phpunit --colors -c $UNIT_XML Tests/Unit
- name: Unit Tests with coverage
if: matrix.typo3 == '^11.5' && matrix.php == '8.3'
run: |
export "UNIT_XML"=.Build/vendor/typo3/testing-framework/Resources/Core/Build/UnitTests.xml
.Build/bin/phpunit --whitelist Classes --coverage-clover=unittest-coverage.clover --colors -c $UNIT_XML Tests/Unit/
- name: Functional Tests without coverage
run: |
export "FUNCTIONAL_XML"=.Build/vendor/typo3/testing-framework/Resources/Core/Build/FunctionalTests.xml
.Build/bin/phpunit --colors -c $FUNCTIONAL_XML Tests/Functional
if: matrix.typo3 != '^11.5' || matrix.php != '8.3'
env:
typo3DatabaseHost: 127.0.0.1
typo3DatabaseName: typo3
typo3DatabasePassword: root
typo3DatabaseUsername: root
- name: Functional Tests with coverage
run: |
export "FUNCTIONAL_XML"=.Build/vendor/typo3/testing-framework/Resources/Core/Build/FunctionalTests.xml
find 'Tests/Functional' -wholename '*Test.php' | parallel --gnu 'echo; echo "Running functional test suite {}"; .Build/bin/phpunit --whitelist Classes --coverage-clover={}functionaltest-coverage.clover --colors -c $FUNCTIONAL_XML {}'
if: matrix.typo3 == '^11.5' && matrix.php == '8.3'
env:
typo3DatabaseHost: 127.0.0.1
typo3DatabaseName: typo3
typo3DatabasePassword: root
typo3DatabaseUsername: root
- name: Upload functional coverage results to Scrutinizer
uses: sudo-bot/action-scrutinizer@latest
if: matrix.typo3 == '^11.5' && matrix.php == '8.3'
with:
cli-args: "--format=php-clover functional-coverage.clover --revision=${{ github.event.pull_request.head.sha || github.sha }}"
- name: Upload unit coverage results to Scrutinizer
uses: sudo-bot/action-scrutinizer@latest
if: matrix.typo3 == '^11.5' && matrix.php == '8.3'
with:
cli-args: "--format=php-clover unittest-coverage.clover --revision=${{ github.event.pull_request.head.sha || github.sha }}"