forked from TYPO3BestPractices/tea
-
Notifications
You must be signed in to change notification settings - Fork 0
93 lines (93 loc) · 3.46 KB
/
Copy pathcodecoverage.yml
File metadata and controls
93 lines (93 loc) · 3.46 KB
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
---
# This GitHub Actions workflow calculates the code coverage of the extension and uploads it to coveralls.io.
name: Code coverage
on:
push:
branches:
- main
pull_request:
permissions:
contents: read
jobs:
code-coverage:
name: Calculate code coverage
permissions:
actions: write
runs-on: ubuntu-24.04
env:
DB_DATABASE: typo3
DB_USER: root
DB_PASSWORD: root
DB_HOST: localhost
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php-version }}"
ini-file: development
tools: composer:v2, phive
extensions: mysqli
coverage: xdebug
- name: Install development tools
run: phive --no-progress install --trust-gpg-keys D8406D0D82947747293778314AA394086372C20A
- name: Show Composer version
run: composer --version
- name: Show the Composer configuration
run: composer config --global --list
- name: Cache dependencies installed with composer
uses: actions/cache@v5
with:
key: "php-${{ matrix.php-version }}-typo3-${{ matrix.typo3-version }}-${{ matrix.composer-dependencies }}-composer-${{ hashFiles('**/composer.json') }}"
path: ~/.cache/composer
restore-keys: "php-${{ matrix.php-version }}-typo3-${{ matrix.typo3-version }}-${{ matrix.composer-dependencies }}-composer-\n"
- name: Install TYPO3 Core
env:
TYPO3: "${{ matrix.typo3-version }}"
run: |
composer require --no-ansi --no-interaction --no-progress --no-install typo3/cms-core:^"$TYPO3"
composer show
- name: Install lowest dependencies with composer
if: "matrix.composer-dependencies == 'Min'"
run: |
composer update --no-ansi --no-interaction --no-progress --with-dependencies --prefer-lowest
composer show
- name: Install highest dependencies with composer
if: "matrix.composer-dependencies == 'Max'"
run: |
composer update --no-ansi --no-interaction --no-progress --with-dependencies
composer show
- name: Start MySQL
run: "sudo /etc/init.d/mysql start"
- name: Run unit tests with coverage
run: composer check:coverage:unit
- name: Show generated coverage files
run: "ls -lahR build/coverage/"
- name: Run functional tests with coverage
run: |
export typo3DatabaseName="$DB_DATABASE";
export typo3DatabaseHost="$DB_HOST";
export typo3DatabaseUsername="$DB_USER";
export typo3DatabasePassword="$DB_PASSWORD";
composer check:coverage:functional
- name: Show generated coverage files
run: "ls -lahR build/coverage/"
- name: Merge coverage results
run: composer check:coverage:merge
- name: Show combined coverage files
run: "ls -lahR build/logs/"
- name: Upload coverage results to Coveralls
uses: coverallsapp/github-action@v2
env:
github-token: ${{ secrets.GITHUB_TOKEN }}
# Note: This is the only path that the Coveralls GitHub Action supports.
# So we cannot use something like .Build/coverage/clover.xml here.
file: build/logs/clover.xml
strategy:
fail-fast: false
matrix:
include:
- typo3-version: "12.4"
php-version: "8.3"
composer-dependencies: Max