1414
1515 runs-on : " ubuntu-latest"
1616
17+ strategy :
18+ matrix :
19+ php-version :
20+ - " 7.1"
21+
1722 steps :
1823 - name : " Checkout"
1924@@ -25,6 +30,115 @@ jobs:
2530 file_or_dir : " ."
2631 strict : true
2732
33+ - name : " Install PHP with extensions"
34+ uses : " shivammathur/setup-php@v2"
35+ with :
36+ coverage : " none"
37+ extensions : " ${{ env.PHP_EXTENSIONS }}"
38+ php-version : " ${{ matrix.php-version }}"
39+
40+ - name : " Validate composer.json and composer.lock"
41+ run : " composer validate --strict"
42+
43+ - name : " Run ergebnis/composer-normalize"
44+ run : " tools/composer-normalize --dry-run"
45+
46+ - name : " Create cache directory for friendsofphp/php-cs-fixer"
47+ run : " mkdir -p .build/php-cs-fixer"
48+
49+ - name : " Cache cache directory for friendsofphp/php-cs-fixer"
50+ uses : " actions/cache@v2"
51+ with :
52+ path : " .build/php-cs-fixer"
53+ key : " php-${{ matrix.php-version }}-php-cs-fixer-${{ hashFiles('tools/php-cs-fixer') }}"
54+ restore-keys : " php-${{ matrix.php-version }}-php-cs-fixer-"
55+
56+ - name : " Run friendsofphp/php-cs-fixer"
57+ run : " tools/php-cs-fixer fix --config=.php_cs --diff --diff-format=udiff --dry-run --verbose"
58+
59+ static-code-analysis :
60+ name : " Static Code Analysis"
61+
62+ runs-on : " ubuntu-latest"
63+
64+ strategy :
65+ matrix :
66+ php-version :
67+ - " 7.4"
68+
69+ dependencies :
70+ - " highest"
71+
72+ steps :
73+ - name : " Checkout"
74+ 75+
76+ - name : " Install PHP with extensions"
77+ uses : " shivammathur/setup-php@v2"
78+ with :
79+ coverage : " none"
80+ php-version : " ${{ matrix.php-version }}"
81+
82+ - name : " Determine composer cache directory"
83+ id : " determine-composer-cache-directory"
84+ run : " echo \" ::set-output name=directory::$(composer config cache-dir)\" "
85+
86+ - name : " Cache dependencies installed with composer"
87+ uses : " actions/cache@v2"
88+ with :
89+ path : " ${{ steps.determine-composer-cache-directory.outputs.directory }}"
90+ key : " php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}"
91+ restore-keys : " php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-"
92+
93+ - name : " Install lowest dependencies from composer.json"
94+ if : " matrix.dependencies == 'lowest'"
95+ run : " composer update --no-interaction --no-progress --no-suggest --prefer-lowest"
96+
97+ - name : " Install locked dependencies from composer.lock"
98+ if : " matrix.dependencies == 'locked'"
99+ run : " composer install --no-interaction --no-progress --no-suggest"
100+
101+ - name : " Install highest dependencies from composer.json"
102+ if : " matrix.dependencies == 'highest'"
103+ run : " composer update --no-interaction --no-progress --no-suggest"
104+
105+ - name : " Create cache directory for vimeo/psalm"
106+ run : " mkdir -p .build/psalm"
107+
108+ - name : " Cache cache directory for vimeo/psalm"
109+ uses : " actions/cache@v2"
110+ with :
111+ path : " .build/psalm"
112+ key : " php-${{ matrix.php-version }}-psalm-${{ github.sha }}"
113+ restore-keys : " php-${{ matrix.php-version }}-psalm-"
114+
115+ - name : " Run vimeo/psalm"
116+ run : " tools/psalm --config=psalm.xml --diff --diff-methods --shepherd --show-info=false --stats --threads=4"
117+
118+ backward-compatibility :
119+ name : " Backward Compatibility"
120+
121+ runs-on : " ubuntu-latest"
122+
123+ steps :
124+ - name : " Checkout"
125+ 126+ with :
127+ fetch-depth : 0
128+
129+ - name : " Fetch tags"
130+ run : " git fetch --depth=1 origin +refs/tags/*:refs/tags/*"
131+
132+ - name : " Install PHP with extensions"
133+ uses : " shivammathur/setup-php@v2"
134+ with :
135+ php-version : " 7.4"
136+ coverage : " none"
137+ extensions : " intl"
138+
139+ - name : " Run roave/backward-compatibility-check"
140+ run : " tools/roave-backward-compatibility-check --from=1.0.0"
141+
28142 tests :
29143 name : " Tests"
30144
@@ -36,8 +150,11 @@ jobs:
36150 - " 7.1"
37151 - " 7.2"
38152 - " 7.3"
153+ - " 7.4"
154+ - " 8.0"
39155
40156 dependencies :
157+ - " lowest"
41158 - " highest"
42159
43160 steps :
@@ -76,12 +193,71 @@ jobs:
76193 - name : " Run tests with phpunit/phpunit"
77194 run : " vendor/bin/phpunit --configuration=phpunit.xml"
78195
196+ code-coverage :
197+ name : " Code Coverage"
198+
199+ runs-on : " ubuntu-latest"
200+
201+ strategy :
202+ matrix :
203+ php-version :
204+ - " 7.4"
205+
206+ dependencies :
207+ - " highest"
208+
209+ steps :
210+ - name : " Checkout"
211+ 212+
213+ - name : " Install PHP with extensions"
214+ uses : " shivammathur/setup-php@v2"
215+ with :
216+ coverage : " pcov"
217+ extensions : " ${{ env.PHP_EXTENSIONS }}"
218+ php-version : " ${{ matrix.php-version }}"
219+
220+ - name : " Determine composer cache directory"
221+ id : " determine-composer-cache-directory"
222+ run : " echo \" ::set-output name=directory::$(composer config cache-dir)\" "
223+
224+ - name : " Cache dependencies installed with composer"
225+ uses : " actions/cache@v2"
226+ with :
227+ path : " ${{ steps.determine-composer-cache-directory.outputs.directory }}"
228+ key : " php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}"
229+ restore-keys : " php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-"
230+
231+ - name : " Install lowest dependencies from composer.json"
232+ if : " matrix.dependencies == 'lowest'"
233+ run : " composer update --no-interaction --no-progress --no-suggest --prefer-lowest"
234+
235+ - name : " Install locked dependencies from composer.lock"
236+ if : " matrix.dependencies == 'locked'"
237+ run : " composer install --no-interaction --no-progress --no-suggest"
238+
239+ - name : " Install highest dependencies from composer.json"
240+ if : " matrix.dependencies == 'highest'"
241+ run : " composer update --no-interaction --no-progress --no-suggest"
242+
243+ - name : " Collect code coverage with pcov and phpunit/phpunit"
244+ run : " vendor/bin/phpunit --configuration=phpunit.xml --coverage-clover=.build/logs/clover.xml"
245+
246+ - name : " Send code coverage report to Codecov.io"
247+ env :
248+ CODECOV_TOKEN : " ${{ secrets.CODECOV_TOKEN }}"
249+ run : " bash <(curl -s https://codecov.io/bash)"
250+
79251 merge :
80252 name : " Merge"
81253
82254 runs-on : " ubuntu-latest"
83255
84256 needs :
257+ - " backward-compatibility"
258+ - " code-coverage"
259+ - " coding-standards"
260+ - " static-code-analysis"
85261 - " tests"
86262
87263 if : >
0 commit comments