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,70 @@ 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
+ tools : phpunit
26
+ - name : Setup Composer
27
+ uses : ./.github/actions/setup-composer
28
+ - name : Run PHPUnit
29
+ run : composer test -- --do-not-cache-result
30
+ PHP_CodeSniffer :
31
+ runs-on : ubuntu-latest
32
+ steps :
33
+ - name : Checkout
34
+ uses : actions/checkout@v2
35
+ - name : Setup PHP
36
+ uses : shivammathur/setup-php@v2
30
37
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 :
38
+ php-version : latest
39
+ coverage : none
40
+ tools : phpcs
41
+ - name : Setup Composer
42
+ uses : ./.github/actions/setup-composer
43
+ - name : Run PHP_CodeSniffer
44
+ run : composer phpcs -- --no-cache
45
+ PHP-CS-Fixer :
41
46
runs-on : ubuntu-latest
42
47
steps :
43
48
- name : Checkout
44
49
uses : actions/checkout@v2
45
50
- name : Setup PHP
46
51
uses : shivammathur/setup-php@v2
47
52
with :
48
- php-version : ' 7.4 '
53
+ php-version : latest
49
54
coverage : none
50
- tools : cs2pr, php-cs-fixer, phpcs
55
+ tools : php-cs-fixer
56
+ - name : Setup Composer
57
+ uses : ./.github/actions/setup-composer
51
58
- 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
59
+ run : composer php-cs-fixer -- --dry-run --diff --using-cache=no
60
+ composer-normalize :
61
+ runs-on : ubuntu-latest
62
+ steps :
63
+ - name : Checkout
64
+ uses : actions/checkout@v2
65
+ - name : Setup PHP
66
+ uses : shivammathur/setup-php@v2
67
+ with :
68
+ php-version : latest
69
+ coverage : none
70
+ tools : composer-normalize
71
+ - name : Setup Composer
72
+ uses : ./.github/actions/setup-composer
73
+ - name : Run composer-normalize
74
+ run : composer normalize --dry-run
55
75
coverage :
56
76
runs-on : ubuntu-latest
57
77
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
78
+ - name : Checkout
79
+ uses : actions/checkout@v2
80
+ - name : Setup PHP
81
+ uses : shivammathur/setup-php@v2
82
+ with :
83
+ php-version : latest
84
+ coverage : xdebug
85
+ tools : phpunit
86
+ - name : Setup Composer
87
+ uses : ./.github/actions/setup-composer
88
+ - name : Run PHPUnit with coverage
89
+ run : composer test -- --do-not-cache-result --coverage-clover coverage.xml
90
+ - name : Upload coverage
91
+ uses : codecov/codecov-action@v1
0 commit comments