mirror of
https://github.com/FriendsOfTYPO3/tea.git
synced 2024-09-20 02:16:13 +02:00
65c59cee1c
We generally should run the faster tests first so that any possible breakage occurs as soon as possible, hence providing faster feedback.
67 lines
2.2 KiB
YAML
67 lines
2.2 KiB
YAML
---
|
|
# This GitHub Actions workflow is calculating code coverage of extension and creates a badge for it.
|
|
name: Code coverage
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
jobs:
|
|
code-coverage:
|
|
name: "Calculate code coverage"
|
|
runs-on: ubuntu-18.04
|
|
steps:
|
|
- name: "Checkout"
|
|
uses: actions/checkout@v3
|
|
- name: "Install PHP"
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: "${{ matrix.php-version }}"
|
|
coverage: xdebug
|
|
extensions: xdebug, mysqli
|
|
tools: composer:v2.3
|
|
- name: "Show Composer version"
|
|
run: composer --version
|
|
- name: "Cache dependencies installed with composer"
|
|
uses: actions/cache@v3
|
|
with:
|
|
key: "php${{ matrix.php-version }}-typo3${{ matrix.typo3-version }}-composer-${{ hashFiles('**/composer.json') }}"
|
|
path: ~/.cache/composer
|
|
restore-keys: "php${{ matrix.php-version }}-typo3${{ matrix.typo3-version }}-composer-\n"
|
|
- name: "Install TYPO3 Core"
|
|
env:
|
|
TYPO3: "${{ matrix.typo3-version }}"
|
|
run: |
|
|
composer require --no-progress typo3/minimal:"$TYPO3"
|
|
composer show
|
|
- name: "Start MySQL"
|
|
run: "sudo /etc/init.d/mysql start"
|
|
- name: "Run unit tests with coverage"
|
|
run: composer ci:coverage:unit
|
|
- name: "Run functional tests with coverage"
|
|
run: |
|
|
export typo3DatabaseName="typo3";
|
|
export typo3DatabaseHost="127.0.0.1";
|
|
export typo3DatabaseUsername="root";
|
|
export typo3DatabasePassword="root";
|
|
composer ci:coverage:functional
|
|
- name: "Merge coverage results"
|
|
run: composer ci:coverage:merge
|
|
- name: "Generate coverage badge"
|
|
uses: timkrase/phpunit-coverage-badge@v1.2.0
|
|
with:
|
|
report: './build/logs/clover.xml'
|
|
coverage_badge_path: './coverage/badge.svg'
|
|
- name: "Commit PHPUnit coverage results"
|
|
uses: s0/git-publish-subdir-action@develop
|
|
env:
|
|
REPO: self
|
|
BRANCH: code-coverage-badge
|
|
FOLDER: coverage
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
php-version:
|
|
- 7.4
|
|
typo3-version:
|
|
- ^10.4
|