-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (66 loc) · 2.18 KB
/
test.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
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
name: CI
on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop
jobs:
test:
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.env.experimental == true }}
strategy:
fail-fast: false
matrix:
env:
- { php: 8.1}
- { php: 8.2}
- { php: 8.3, experimental: true }
steps:
- uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.env.php }}
- name: Cache dependencies
uses: actions/cache@v2
with:
path: vendor
key: composer-${{ runner.os }}-${{ matrix.env.php }}-${{ hashFiles('composer.*') }}
restore-keys: |
composer-${{ runner.os }}-${{ matrix.env.php }}-${{ hashFiles('composer.*') }}-
composer-${{ runner.os }}-${{ matrix.env.php }}-
composer-${{ runner.os }}-
composer-
- name: Update Composer
run: |
sudo composer self-update
composer --version
- name: Validate composer.json and composer.lock
run: composer validate
- name: Install composer
run: composer install -o --no-interaction --no-suggest --prefer-dist
- name: PHPUnit tests
uses: php-actions/phpunit@v3
env:
XDEBUG_MODE: coverage
with:
coverage_clover: "build/clover.xml"
php_version: "${{ matrix.env.php }}"
php_extensions: "xdebug"
configuration: "phpunit.xml"
- uses: actions/upload-artifact@v3
with:
name: clover
path: build/clover.xml
- name: 'Generate Code Coverage Report'
uses: ./.github/actions/codecoverage
if: ${{ matrix.env.php == '8.2' && github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' }}
- name: Run Infection for added files only
if: ${{ github.event_name == 'pull_request' }}
run: |
git fetch --depth=1 origin $GITHUB_BASE_REF
vendor/bin/infection -j2 --git-diff-filter=A --git-diff-base=origin/$GITHUB_BASE_REF --logger-github --ignore-msi-with-no-mutations