-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (62 loc) · 2.13 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
name: Test TYPO3 Extension
on: [ push, pull_request ]
permissions:
contents: read
pull-requests: write
jobs:
test:
runs-on: ubuntu-latest
name: TYPO3 ${{ matrix.typo3}} on PHP ${{ matrix.php }}
env:
XDEBUG_MODE: coverage
strategy:
fail-fast: true
matrix:
php: [ 8.1, 8.2 ]
typo3: [ 12.4 ]
steps:
- name: 'Checkout code'
uses: actions/checkout@v3
- name: 'Setup PHP'
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer
coverage: 'xdebug3'
extensions: pdo, sqlite3
- name: 'Get Composer Cache Directory'
id: composer-cache
shell: bash
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: 'Cache Composer Dependencies'
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: composer-php${{ matrix.php }}-typo3${{ matrix.typo3 }}
- name: 'Validate composer.json and composer.lock'
shell: bash
run: composer validate --strict
- name: 'Install TYPO3 core'
shell: bash
run: composer require typo3/cms-core="^${{ matrix.typo3 }}" -W
- name: 'Unit Tests'
shell: bash
run: .Build/bin/phpunit -c phpunit.xml
- name: 'Generate code coverage summary report'
uses: saschanowak/CloverCodeCoverageSummary@0.3.1
with:
filename: .Build/logs/coverage/unit.xml
- name: 'Add code coverage to file'
shell: bash
run: |
echo '## Code Coverage Summery for TYPO3 ${{ matrix.typo3}} on PHP ${{ matrix.php }}' >> code-coverage-merged.md
cat code-coverage-summary.md >> code-coverage-merged.md
cat code-coverage-merged.md >> $GITHUB_STEP_SUMMARY
cat code-coverage-details.md >> $GITHUB_STEP_SUMMARY
- name: 'Add code coverage as pr comment'
uses: marocchino/sticky-pull-request-comment@v2
if: github.event_name == 'pull_request'
with:
recreate: true
path: code-coverage-merged.md