-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (41 loc) · 1.23 KB
/
ci.yaml
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
name: CI
on:
push:
pull_request:
jobs:
PHPUnit:
name: PHPUnit (PHP ${{ matrix.php }})
if: "!contains(github.event.head_commit.message, '[CI SKIP]')"
runs-on: ubuntu-22.04
env:
PLUGIN_PATH: Customizing/global/libs/ilias-plugin-utils
strategy:
matrix:
php:
- 8.0
- 7.4
steps:
- uses: actions/checkout@v4
with:
repository: ILIAS-eLearning/ILIAS
ref: release_8
- uses: actions/checkout@v4
with:
path: ${{ env.PLUGIN_PATH }}
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: xdebug
ini-file: development
- run: composer install
working-directory: ${{ env.PLUGIN_PATH }}
- run: composer install --no-dev
- run: vendor/bin/phpunit --coverage-text --coverage-clover=clover.xml
working-directory: ${{ env.PLUGIN_PATH }}
- name: Check 100% code coverage
shell: php {0}
run: |
<?php
$metrics = simplexml_load_file('clover.xml')->project->metrics;
exit((int) $metrics['statements'] === (int) $metrics['coveredstatements'] ? 0 : 1);
working-directory: ${{ env.PLUGIN_PATH }}