-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (64 loc) · 1.96 KB
/
PHPUnit.yaml
File metadata and controls
77 lines (64 loc) · 1.96 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
name: PHPUnit
on:
pull_request:
merge_group:
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true
jobs:
file-diff:
runs-on: ubuntu-latest
name: File Diff
outputs:
php_diff: ${{ steps.php_diff_files.outputs.diff }}
steps:
- name: Checkout source code
uses: actions/checkout@v3
- name: Check PHP files diff
id: php_diff_files
uses: technote-space/get-diff-action@v6
with:
PATTERNS: |
**/*.php
composer.+(json|lock)
.github/**/*.yml
test:
runs-on: ubuntu-latest
needs: [ 'file-diff' ]
if: ${{ github.event.pull_request.title == null || needs.file-diff.outputs.php_diff }}
strategy:
fail-fast: false
matrix:
php_versions: [ '8.1', '8.3' ]
name: PHPUnit - PHP version ${{ matrix.php_versions }}
services:
mysql:
image: mysql:5.7
env:
MYSQL_ROOT_PASSWORD: root
ports:
- 3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: none
- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest
- name: Run PHPUnit tests
run: ./vendor/bin/phpunit
test-result:
needs: test
if: ${{ always() }} # Will be run even if 'test' matrix will be skipped
runs-on: ubuntu-20.04
name: PHPUnit - Test Results
steps:
- name: Test status
run: echo "Test status is - ${{ needs.test.result }}"
- name: Check test matrix status
if: ${{ needs.test.result != 'success' && needs.test.result != 'skipped' }}
run: exit 1