@@ -6,9 +6,9 @@ name: build
66
77jobs :
88 tests :
9- name : PHP ${{ matrix.php-version }}-${{ matrix.os }}
9+ name : PHP ${{ matrix.php }}-${{ matrix.os }}
10+
1011 env :
11- extensions : curl, mbstring, dom, intl, json, libxml, xml, xmlwriter
1212 key : cache-v1
1313
1414 runs-on : ${{ matrix.os }}
@@ -19,76 +19,56 @@ jobs:
1919 - ubuntu-latest
2020 - windows-latest
2121
22- php-version :
22+ php :
2323 - " 7.4"
2424 - " 8.0"
2525
2626 steps :
2727 - name : Checkout
2828 uses : actions/checkout@v2
2929
30- - name : Setup cache environment
31- id : cache-env
32- uses : shivammathur/cache-extensions@v1
33- with :
34- php-version : ${{ matrix.php-version }}
35- extensions : ${{ env.extensions }}
36- key : ${{ env.key }}
37-
38- - name : Cache extensions
39- uses : actions/cache@v1
40- with :
41- path : ${{ steps.cache-env.outputs.dir }}
42- key : ${{ steps.cache-env.outputs.key }}
43- restore-keys : ${{ steps.cache-env.outputs.key }}
44-
45- - name : Install PHP with extensions
30+ - name : Install PHP
4631 uses : shivammathur/setup-php@v2
4732 with :
48- php-version : ${{ matrix.php-version }}
49- extensions : ${{ env.extensions }}
33+ php-version : ${{ matrix.php }}
5034 ini-values : date.timezone='UTC'
5135 coverage : pcov
5236 tools : composer:v2
5337
5438 - name : Determine composer cache directory on Linux
5539 if : matrix.os == 'ubuntu-latest'
56- run : echo "::set-env name= COMPOSER_CACHE_DIR:: $(composer config cache-dir)"
40+ run : echo "COMPOSER_CACHE_DIR= $(composer config cache-dir)" >> $GITHUB_ENV
5741
5842 - name : Determine composer cache directory on Windows
5943 if : matrix.os == 'windows-latest'
60- run : ECHO "::set-env name= COMPOSER_CACHE_DIR:: ~\AppData\Local\Composer"
44+ run : echo " COMPOSER_CACHE_DIR= ~\AppData\Local\Composer" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
6145
6246 - name : Cache dependencies installed with composer
63- uses : actions/cache@v1
47+ uses : actions/cache@v2
6448 with :
6549 path : ${{ env.COMPOSER_CACHE_DIR }}
66- key : php${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}
50+ key : php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
6751 restore-keys : |
68- php${{ matrix.php-version }}-composer-
52+ php${{ matrix.php }}-composer-
6953
7054 - name : Install dependencies with composer php 7.4
71- if : matrix.php-version == '7.4'
72- run : composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader
55+ if : matrix.php == '7.4'
56+ run : composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
7357
7458 - name : Install dependencies with composer php 8.0
75- if : matrix.php-version == '8.0'
76- run : composer update --ignore-platform-reqs --prefer-dist --no-interaction --no-progress --optimize-autoloader
59+ if : matrix.php == '8.0'
60+ run : composer update --ignore-platform-reqs --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
7761
7862 - name : Run tests with phpunit and coverage on Linux php 7.4
79- if : matrix.os == 'ubuntu-latest' && matrix.php-version == '7.4'
80- run : vendor/bin/phpunit --coverage-clover=coverage.clover
81-
82- - name : Run tests with phpunit without coverage on Linux php 8.0
83- if : matrix.os == 'ubuntu-latest' && matrix.php-version == '8.0'
84- run : vendor/bin/phpunit
63+ if : matrix.os == 'ubuntu-latest' && matrix.php == '7.4'
64+ run : vendor/bin/phpunit --coverage-clover=coverage.clover --colors=always
8565
86- - name : Run tests with phpunit without coverage on Windows
87- if : matrix.os == 'windows -latest'
88- run : vendor/bin/phpunit
66+ - name : Run tests with phpunit without coverage on Windows php 7.4 - 8.0 and Linux php 8.0
67+ if : matrix.os != 'ubuntu -latest' || matrix.php != '7.4 '
68+ run : vendor/bin/phpunit --colors=always
8969
9070 - name : Upload code coverage scrutinizer on Linux php 7.4
91- if : matrix.os == 'ubuntu-latest' && matrix.php-version == '7.4'
71+ if : matrix.os == 'ubuntu-latest' && matrix.php == '7.4'
9272 run : |
9373 wget https://scrutinizer-ci.com/ocular.phar
9474 php ocular.phar code-coverage:upload --format=php-clover coverage.clover
0 commit comments