11# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
22
33on :
4- - " pull_request"
5- - " push"
4+ - pull_request
5+ - push
66
7- name : " CI "
7+ name : CI
88
99jobs :
1010 coding-guidelines :
11- name : " Coding Guidelines"
11+ name : Coding Guidelines
1212
13- runs-on : " ubuntu-latest"
13+ runs-on : ubuntu-latest
1414
1515 steps :
16- - name : " Checkout"
17- uses : " actions/checkout@v2"
16+ - name : Checkout
17+ uses : actions/checkout@v2
18+
19+ - name : Install PHP
20+ uses : shivammathur/setup-php@v2
21+ with :
22+ php-version : 8.0
23+ extensions : :apcu, :imagick
24+ coverage : none
25+ tools : none
1826
19- - name : " Run friendsofphp/php-cs-fixer"
20- run : " ./tools/php-cs-fixer fix --dry-run --show-progress=dots --using-cache=no --verbose"
27+ - name : Run friendsofphp/php-cs-fixer
28+ run : ./tools/php-cs-fixer fix --dry-run --show-progress=dots --using-cache=no --verbose
2129
2230 type-checker :
2331 name : Type Checker
3240 uses : shivammathur/setup-php@v2
3341 with :
3442 php-version : 8.0
43+ extensions : :apcu, :imagick
3544 coverage : none
45+ tools : none
3646
3747 - name : Update dependencies with composer
3848 run : ./tools/composer update --no-interaction --no-ansi --no-progress
@@ -41,13 +51,21 @@ jobs:
4151 run : ./tools/psalm --config=.psalm/config.xml --no-progress --shepherd --show-info=false --stats
4252
4353 tests :
44- name : " Tests"
54+ name : Tests
4555
46- runs-on : " ubuntu-latest"
56+ runs-on : ${{ matrix.os }}
57+
58+ env :
59+ PHP_EXTENSIONS : dom, json, libxml, mbstring, pdo_sqlite, soap, xml, xmlwriter, :apcu, :imagick
60+ PHP_INI_VALUES : memory_limit=-1, assert.exception=1, zend.assertions=1, error_reporting=-1, log_errors_max_len=0, display_errors=On
4761
4862 strategy :
4963 fail-fast : false
5064 matrix :
65+ os :
66+ - ubuntu-latest
67+ - windows-latest
68+
5169 php-version :
5270 - " 8.0"
5371 - " 8.1"
@@ -56,30 +74,64 @@ jobs:
5674 - " pcov"
5775 - " xdebug3"
5876
77+ compiler :
78+ - default
79+
80+ dependencies :
81+ - lowest
82+ - highest
83+
84+ include :
85+ - os : ubuntu-latest
86+ php-version : " 8.0"
87+ compiler : jit
88+ dependencies : highest
89+
90+ - os : ubuntu-latest
91+ php-version : " 8.1"
92+ compiler : jit
93+ dependencies : highest
94+
95+ exclude :
96+ - php-version : " 8.0"
97+ coverage-driver : " xdebug"
98+
99+ - php-version : " 8.1"
100+ coverage-driver : " xdebug"
101+
59102 steps :
60- - name : " Checkout"
61- uses : " actions/checkout@v2"
103+ - name : Configure git to avoid issues with line endings
104+ if : matrix.os == 'windows-latest'
105+ run : git config --global core.autocrlf false
62106
63- - name : " Install PHP"
64- uses : " shivammathur/setup-php@v2"
65- with :
66- php-version : " ${{ matrix.php-version }}"
67- coverage : " ${{ matrix.coverage-driver }}"
107+ - name : Checkout
108+ uses : actions/checkout@v2
109+
110+ - name : Override PHP ini values for JIT compiler
111+ if : matrix.compiler == 'jit'
112+ run : echo "PHP_INI_VALUES::assert.exception=1, memory_limit=-1, zend.assertions=1, opcache.enable=1, opcache.enable_cli=1, opcache.optimization_level=-1, opcache.jit=1255, opcache.jit_buffer_size=32M" >> $GITHUB_ENV
68113
69- - name : " Cache dependencies installed with composer "
70- uses : " actions/cache @v2"
114+ - name : Install PHP with extensions
115+ uses : shivammathur/setup-php @v2
71116 with :
72- path : " ~/.composer/cache"
73- key : " php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.json') }}"
74- restore-keys : " php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-"
117+ php-version : ${{ matrix.php-version }}
118+ coverage : ${{ matrix.coverage-driver }}
119+ extensions : ${{ env.PHP_EXTENSIONS }}
120+ ini-values : ${{ env.PHP_INI_VALUES }}
121+ tools : none
122+
123+ - name : Install lowest dependencies with composer
124+ if : matrix.dependencies == 'lowest'
125+ run : php ./tools/composer update --no-ansi --no-interaction --no-progress --prefer-lowest
75126
76- - name : " Install dependencies with composer"
77- run : " ./tools/composer update --no-ansi --no-interaction --no-progress"
127+ - name : Install highest dependencies with composer
128+ if : matrix.dependencies == 'highest'
129+ run : php ./tools/composer update --no-ansi --no-interaction --no-progress
78130
79- - name : " Run tests with phpunit/phpunit"
80- run : " vendor/bin/phpunit --coverage-clover=coverage.xml"
131+ - name : Run tests with phpunit/phpunit
132+ run : vendor/bin/phpunit --coverage-clover=coverage.xml
81133
82- - name : " Send code coverage report to Codecov.io"
83- env :
84- CODECOV_TOKEN : " ${{ secrets.CODECOV_TOKEN }} "
85- run : " bash <(curl -s https://codecov.io/bash) || true "
134+ - name : Send code coverage report to Codecov.io
135+ uses : codecov/codecov-action@v1
136+ with :
137+ token : ${{ secrets.CODECOV_TOKEN }}
0 commit comments