-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (42 loc) · 1.34 KB
/
Copy pathphpunit.yaml
File metadata and controls
49 lines (42 loc) · 1.34 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
name: PHPUnit
env:
COMPOSE_USER: runner
COMPOSE_DOMAIN: ci.local
on:
pull_request:
push:
branches:
- main
- develop
paths:
- "**/*.php"
- "phpunit.xml.dist"
- "composer.json"
- "composer.lock"
- "docker-compose.yml"
- "docker-compose.postgres.yml"
- "docker-compose.php85.yml"
- "docker/**"
- ".github/workflows/phpunit.yaml"
jobs:
phpunit:
name: PHPUnit (${{ matrix.database }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- database: mariadb
compose-files: "-f docker-compose.yml"
- database: postgres
compose-files: "-f docker-compose.yml -f docker-compose.postgres.yml"
steps:
- uses: actions/checkout@v6
- name: Create docker network
run: docker network create frontend
- name: Install dependencies
run: docker compose ${{ matrix.compose-files }} run --rm phpfpm composer install
- name: Run PHPUnit with coverage
run: docker compose ${{ matrix.compose-files }} run -e XDEBUG_MODE=coverage --rm phpfpm vendor/bin/phpunit --coverage-clover=coverage/clover.xml
- name: Enforce coverage threshold (100%)
run: docker compose ${{ matrix.compose-files }} run --rm phpfpm vendor/bin/coverage-check coverage/clover.xml 100