-
-
Notifications
You must be signed in to change notification settings - Fork 7
77 lines (77 loc) · 2.81 KB
/
test.yml
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: Tests
on: [push, pull_request]
jobs:
php:
name: PHP ${{ matrix.php-versions }} on ${{ matrix.operating-system }} Composer ${{ matrix.composer }} (${{ matrix.dependencies }})
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest]
composer: [v2]
dependencies: [highest]
php-versions:
- '5.3'
- '5.4'
- '5.5'
- '5.6'
- '7.0'
- '7.1'
- '7.2'
- '7.3'
- '7.4'
- '8.0'
- '8.1'
- '8.2'
- '8.3'
- '8.4'
include:
- php-versions: '5.3'
dependencies: 'lowest'
composer: v1 # Global composer should be in same version as locally installed one
operating-system: ubuntu-latest
- php-versions: '7.0'
dependencies: 'lowest'
composer: v1
operating-system: ubuntu-latest
- php-versions: '8.2'
composer: v2
operating-system: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: json
coverage: xdebug
tools: composer:${{ matrix.composer }}
- name: Install Composer dependencies (${{ matrix.dependencies }})
uses: ramsey/composer-install@v3
with:
dependency-versions: ${{ matrix.dependencies }}
- name: Check PSR-4 mapping
if: ${{ matrix.php-versions == 8.3 && matrix.composer == 'v2' }}
run: composer dump-autoload --dev --optimize --strict-psr
- name: Set default branch for tests
run: git config --global init.defaultBranch main
- name: Run Tests
run: vendor/bin/simple-phpunit --coverage-clover coverage.xml --coverage-text
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Run mutation tests
if: ${{ matrix.php-versions == 8.3 && matrix.operating-system == 'ubuntu-latest' }}
env:
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
run: |
composer config --no-plugins allow-plugins.infection/extension-installer true
composer require infection/infection --update-with-all-dependencies
vendor/bin/infection --ignore-msi-with-no-mutations --min-covered-msi=100 --min-msi=100 -s -j4 --only-covered
- name: Run phpstan
if: ${{ matrix.php-versions == 8.3 && matrix.operating-system == 'ubuntu-latest' }}
run: |
composer require phpstan/phpstan --dev
vendor/bin/phpstan