1010 - ' psalm.xml'
1111
1212 push :
13+ branches : ['master']
1314 paths-ignore :
1415 - ' docs/**'
1516 - ' README.md'
@@ -23,68 +24,11 @@ name: build
2324
2425jobs :
2526 phpunit :
26- name : PHP ${{ matrix.php }}-${{ matrix.os }}
27-
28- runs-on : ${{ matrix.os }}
29-
30- strategy :
31- matrix :
32- os :
33- - ubuntu-latest
34- - windows-latest
35-
36- php :
37- - 8.1
38- - 8.2
39- - 8.3
40-
41- exclude :
42- - os : windows-latest
43- php : 8.2
44-
45- - os : windows-latest
46- php : 8.3
47-
48- steps :
49- - name : Checkout.
50- uses : actions/checkout@v3
51-
52- - name : Install PHP with extensions.
53- uses : shivammathur/setup-php@v2
54- with :
55- coverage : pcov
56- extensions : uopz
57- ini-values : date.timezone='UTC'
58- php-version : ${{ matrix.php }}
59- tools : composer:v2
60-
61- - name : Determine composer cache directory on Linux.
62- if : matrix.os == 'ubuntu-latest'
63- run : echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV
64-
65- - name : Determine composer cache directory on Windows.
66- if : matrix.os == 'windows-latest'
67- run : echo "COMPOSER_CACHE_DIR=~\AppData\Local\Composer" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
68-
69- - name : Cache dependencies installed with composer.
70- uses : actions/cache@v3
71- with :
72- path : ${{ env.COMPOSER_CACHE_DIR }}
73- key : php${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
74- restore-keys : |
75- php${{ matrix.php }}-composer-
76-
77- - name : Update composer.
78- run : composer self-update
79-
80- - name : Install dependencies with composer.
81- run : composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
82-
83- - name : Run tests with phpunit with code coverage.
84- run : vendor/bin/phpunit --coverage-clover=coverage.xml --colors=always --configuration phpunit.xml.dist
85-
86- - name : Upload coverage to Codecov.
87- if : matrix.os == 'ubuntu-latest'
88- uses : codecov/codecov-action@v3
89- with :
90- files : ./coverage.xml
27+ uses : yiisoft/actions/.github/workflows/phpunit.yml@master
28+ secrets :
29+ codecovToken : ${{ secrets.CODECOV_TOKEN }}
30+ with :
31+ os : >-
32+ ['ubuntu-latest', 'windows-latest']
33+ php : >-
34+ ['8.1', '8.2', '8.3', '8.4']
0 commit comments