8
8
workflow_dispatch :
9
9
10
10
jobs :
11
- tests :
11
+ PHPUnit :
12
12
strategy :
13
13
matrix :
14
- operating-system : [ubuntu-latest]
15
- php-versions : ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1']
14
+ operating-system : [ ' ubuntu-latest', 'windows-latest', 'macos-latest' ]
15
+ php-versions : [ '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1' ]
16
16
runs-on : ${{ matrix.operating-system }}
17
17
steps :
18
18
- name : Checkout
@@ -22,60 +22,72 @@ jobs:
22
22
with :
23
23
php-version : ${{ matrix.php-versions }}
24
24
coverage : none
25
- - name : Get composer cache directory
26
- id : composer-cache
27
- run : echo "::set-output name=dir::$(composer config cache-files-dir)"
28
- - name : Cache composer dependencies
29
- uses : actions/cache@v2
25
+ ini-values : error_reporting=E_ALL
26
+ - name : Setup Composer
27
+ uses : ./.github/actions/setup-composer
28
+ - name : Install PHPUnit
29
+ run : composer require --dev phpunit/phpunit
30
+ - name : Run PHPUnit
31
+ run : composer test
32
+ PHP_CodeSniffer :
33
+ runs-on : ubuntu-latest
34
+ steps :
35
+ - name : Checkout
36
+ uses : actions/checkout@v2
37
+ - name : Setup PHP
38
+ uses : shivammathur/setup-php@v2
30
39
with :
31
- path : ${{ steps.composer-cache.outputs.dir }}
32
- key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
33
- restore-keys : ${{ runner.os }}-composer-
34
- - name : Install dependencies
35
- run : composer install --no-progress --prefer-dist --classmap-authoritative --no-interaction
36
- - name : Setup problem matchers for PHPUnit
37
- run : echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
38
- - name : Test with phpunit
39
- run : vendor/bin/phpunit
40
- lint :
40
+ php-version : latest
41
+ coverage : none
42
+ tools : phpcs
43
+ - name : Setup Composer
44
+ uses : ./.github/actions/setup-composer
45
+ - name : Run PHP_CodeSniffer
46
+ run : composer phpcs -- --no-cache
47
+ PHP-CS-Fixer :
41
48
runs-on : ubuntu-latest
42
49
steps :
43
50
- name : Checkout
44
51
uses : actions/checkout@v2
45
52
- name : Setup PHP
46
53
uses : shivammathur/setup-php@v2
47
54
with :
48
- php-version : ' 7.4 '
55
+ php-version : latest
49
56
coverage : none
50
- tools : cs2pr, php-cs-fixer, phpcs
57
+ tools : php-cs-fixer
58
+ - name : Setup Composer
59
+ uses : ./.github/actions/setup-composer
51
60
- name : Run PHP Coding Standards Fixer
52
- run : php-cs-fixer fix --dry-run --using-cache=no --format=checkstyle | cs2pr
53
- - name : Run PHP_CodeSniffer
54
- run : phpcs --standard=PSR12 --exclude=PSR12.Properties.ConstantVisibility -q --report=checkstyle src tests | cs2pr
61
+ run : composer php-cs-fixer -- --dry-run --diff --using-cache=no
62
+ composer-normalize :
63
+ runs-on : ubuntu-latest
64
+ steps :
65
+ - name : Checkout
66
+ uses : actions/checkout@v2
67
+ - name : Setup PHP
68
+ uses : shivammathur/setup-php@v2
69
+ with :
70
+ php-version : latest
71
+ coverage : none
72
+ tools : composer-normalize
73
+ - name : Setup Composer
74
+ uses : ./.github/actions/setup-composer
75
+ - name : Run composer-normalize
76
+ run : composer-normalize --dry-run
55
77
coverage :
56
78
runs-on : ubuntu-latest
57
79
steps :
58
- - name : Checkout
59
- uses : actions/checkout@v2
60
- - name : Setup PHP
61
- uses : shivammathur/setup-php@v2
62
- with :
63
- php-version : ' 8.0'
64
- coverage : xdebug
65
- - name : Get composer cache directory
66
- id : composer-cache
67
- run : echo "::set-output name=dir::$(composer config cache-files-dir)"
68
- - name : Cache composer dependencies
69
- uses : actions/cache@v2
70
- with :
71
- path : ${{ steps.composer-cache.outputs.dir }}
72
- key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
73
- restore-keys : ${{ runner.os }}-composer-
74
- - name : Install dependencies
75
- run : composer install --no-progress --prefer-dist --classmap-authoritative --no-interaction
76
- - name : Setup problem matchers for PHPUnit
77
- run : echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
78
- - name : Test with phpunit
79
- run : vendor/bin/phpunit --coverage-clover coverage.xml
80
- - name : Upload coverage
81
- uses : codecov/codecov-action@v1
80
+ - name : Checkout
81
+ uses : actions/checkout@v2
82
+ - name : Setup PHP
83
+ uses : shivammathur/setup-php@v2
84
+ with :
85
+ php-version : latest
86
+ coverage : xdebug
87
+ tools : phpunit
88
+ - name : Setup Composer
89
+ uses : ./.github/actions/setup-composer
90
+ - name : Run PHPUnit with coverage
91
+ run : composer test -- --do-not-cache-result --coverage-clover coverage.xml
92
+ - name : Upload coverage
93
+ uses : codecov/codecov-action@v1
0 commit comments