@@ -2,167 +2,114 @@ name: CI
22
33on :
44 pull_request :
5- branches :
6- - " *.*"
7- - master
85 push :
96 branches :
107 - " *.*"
118 - master
12-
13- env :
14- COMPOSER_ROOT_VERSION : " 1.4"
9+ schedule :
10+ - cron : " 0 4 * * *"
1511
1612jobs :
17- build :
18- runs-on : ubuntu-16 .04
13+ tests :
14+ runs-on : ubuntu-20 .04
1915 strategy :
2016 fail-fast : false
2117 matrix :
18+ php-version :
19+ - ' 8.0'
20+ - ' 8.1'
21+ symfony-version :
22+ - ' 5.4.*'
23+ - ' 6.0.*'
24+ dependencies :
25+ - ' lowest'
26+ - ' highest'
27+ remove-dependencies : [ '' ]
28+ coverage : [ 'none' ]
2229 include :
23- - php-version : 7.4
24- symfony-version : " 4.4.*"
25-
26- - php-version : 7.4
27- symfony-version : " 4.4.*"
28- validator : false
29-
30- - php-version : 7.4
31- symfony-version : " 5.0.*"
32-
33- - php-version : 7.4
34- symfony-version : " 5.1.*"
35-
36- - php-version : 7.4
37- symfony-version : " 5.2.*"
38-
39- - php-version : 8.0
40- symfony-version : " 5.2.*"
41-
42- name : " PHP ${{ matrix.php-version }} / Symfony ${{ matrix.symfony-version }} Test"
43-
30+ - php-version : ' 8.0'
31+ symfony-version : ' 5.4.*'
32+ dependencies : ' lowest'
33+ remove-dependencies : ' --dev symfony/validator doctrine/orm doctrine/annotations'
34+ - php-version : ' 8.1'
35+ symfony-version : ' 5.4.*'
36+ dependencies : ' lowest'
37+ coverage : " pcov"
4438 steps :
4539 - name : " Checkout"
4640 uses : " actions/checkout@v2"
47- with :
48- fetch-depth : 50
4941
50- - name : " Install PHP without coverage "
42+ - name : " Install PHP"
5143 uses : " shivammathur/setup-php@v2"
5244 with :
45+ tools : flex
5346 php-version : " ${{ matrix.php-version }}"
54- coverage : " none"
55-
56- - name : " Cache dependencies installed with composer"
57- uses : " actions/cache@v2"
58- with :
59- path : " ~/.composer/cache"
60- key : " php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
61- restore-keys : " php-${{ matrix.php-version }}-composer-locked-"
47+ coverage : " ${{ matrix.coverage }}"
6248
6349 - name : " Change stability"
64- if : matrix.stability != ''
65- run : perl -pi -e 's/^}$/,"minimum-stability":"'"${{ matrix.minimum-stability }}"'"}/' composer.json
66-
67- - name : " Symfony version"
68- if : matrix.symfony-version != ''
69- run : perl -pi -e 's#"(symfony/.*)":\s*".*"#"$1":"'"${{ matrix.symfony-version }}"'"#' composer.json
70-
71- - name : " PhpUnit version"
72- if : matrix.phpunit-version != ''
73- run : composer req "phpunit/phpunit:${{ matrix.phpunit-version }}" --dev --no-update
50+ if : " matrix.stability != ''"
51+ run : perl -pi -e 's/^}$/,"minimum-stability":"'"${{ matrix.minimum-stability }}"'"}/' composer.json && cat composer.json
7452
7553 - name : " Webonyx GraphQL version"
76- if : matrix.graphql-version != ''
77- run : composer req "webonyx/graphql-php:${{ matrix.graphql-version }}" --dev --no-update
54+ if : " matrix.graphql-version != ''"
55+ run : composer require "webonyx/graphql-php:${{ matrix.graphql-version }}" --dev --no-update
7856
79- - name : " Disabled validator if needed "
80- if : matrix.validator == false
81- run : composer remove "symfony/validator" --dev -- no-update;
57+ - name : Remove dependencies
58+ if : " matrix.remove-dependencies != '' "
59+ run : composer remove -- no-update ${{ matrix.remove-dependencies }}
8260
8361 - name : " Install dependencies"
84- run : composer update --no-interaction --no-progress ${{ matrix.composer-flags }}
85-
86- - name : " Set USE_EXPERIMENTAL_EXECUTOR if needed"
87- if : matrix.experimental-executor != ''
88- run : export USE_EXPERIMENTAL_EXECUTOR=${{ matrix.experimental-executor }}
89-
90- - name : " Set SYMFONY_DEPRECATIONS_HELPER if needed"
91- if : matrix.symfony-deprecation-helper != ''
92- run : export SYMFONY_DEPRECATIONS_HELPER=${{ matrix.symfony-deprecation-helper }}
62+ uses : ramsey/composer-install@v2
63+ with :
64+ dependency-versions : ${{ matrix.dependencies }}
65+ env :
66+ SYMFONY_REQUIRE : " ${{ matrix.symfony-version }}"
9367
9468 - name : " Run tests"
9569 run : composer test
9670
71+ - name : " Upload coverage results to Coveralls"
72+ if : " matrix.coverage == 'pcov'"
73+ env :
74+ COVERALLS_REPO_TOKEN : ${{ secrets.GITHUB_TOKEN }}
75+ run : |
76+ wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.5.1/php-coveralls.phar
77+ php php-coveralls.phar --coverage_clover=build/logs/clover.xml -v
9778 coding-standard :
98- runs-on : ubuntu-16 .04
79+ runs-on : ubuntu-20 .04
9980 name : Coding Standard
10081 steps :
10182 - name : " Checkout"
10283 uses : " actions/checkout@v2"
103- with :
104- fetch-depth : 50
10584
106- - name : " Install PHP without coverage "
85+ - name : " Install PHP"
10786 uses : " shivammathur/setup-php@v2"
10887 with :
109- php-version : " 7.4"
110- coverage : " none"
111-
112- - name : " Cache dependencies installed with composer"
113- uses : " actions/cache@v2"
114- with :
115- path : " ~/.composer/cache"
116- key : " php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
117- restore-keys : " php-${{ matrix.php-version }}-composer-locked-"
88+ tools : flex
89+ php-version : " 8.1"
11890
11991 - name : " Install dependencies"
120- run : composer update --no-interaction --no-progress
92+ uses : ramsey/ composer-install@v2
12193
12294 - name : " Check coding standard"
12395 run : composer check-cs
12496
125- benchmark :
126- runs-on : ubuntu-16.04
127- name : Benchmark
128- steps :
129- - name : " Checkout"
130- uses : " actions/checkout@v2"
131- with :
132- fetch-depth : 50
133-
134- - name : " Install PHP without coverage"
135- uses : " shivammathur/setup-php@v2"
136- with :
137- php-version : " 7.4"
138- coverage : " none"
139-
140- - name : " Cache dependencies installed with composer"
141- uses : " actions/cache@v2"
142- with :
143- path : " ~/.composer/cache"
144- key : " php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
145- restore-keys : " php-${{ matrix.php-version }}-composer-locked-"
146-
147- - name : " Install dependencies"
148- run : composer update --no-interaction --no-progress
149-
150- - name : " Run benchmark"
151- run : composer bench
152-
15397 static-analysis :
154- runs-on : ubuntu-16 .04
98+ runs-on : ubuntu-20 .04
15599 name : " Static analysis"
100+ strategy :
101+ fail-fast : false
102+ matrix :
103+ php-version :
104+ - ' 8.1'
156105 steps :
157106 - name : " Checkout"
158107 uses : " actions/checkout@v2"
159- with :
160- fetch-depth : 50
161108
162- - name : " Install PHP with coverage "
109+ - name : " Install PHP"
163110 uses : " shivammathur/setup-php@v2"
164111 with :
165- php-version : " 7.4 "
112+ php-version : ${{ matrix.php-version }}
166113 coverage : " none"
167114
168115 - name : " Cache dependencies installed with composer"
@@ -173,49 +120,7 @@ jobs:
173120 restore-keys : " php-${{ matrix.php-version }}-composer-locked-"
174121
175122 - name : " Install dependencies"
176- run : composer update --no-interaction --no-progress
123+ uses : ramsey/ composer-install@v2
177124
178125 - name : " Run static-analysis"
179126 run : composer static-analysis
180-
181- coverage :
182- runs-on : ubuntu-16.04
183- name : " Coverage"
184- steps :
185- - name : " Checkout"
186- uses : " actions/checkout@v2"
187- with :
188- fetch-depth : 50
189-
190- - name : " Install PHP with coverage"
191- uses : " shivammathur/setup-php@v2"
192- with :
193- php-version : " 8.0"
194- ini-values : pcov.directory=.
195- coverage : " pcov"
196-
197- - name : " Cache dependencies installed with composer"
198- uses : " actions/cache@v2"
199- with :
200- path : " ~/.composer/cache"
201- key : " php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
202- restore-keys : " php-${{ matrix.php-version }}-composer-locked-"
203-
204- - name : " Install Ocular as depencies"
205- run : composer req "scrutinizer/ocular" --dev --no-update
206-
207- - name : " Install dependencies"
208- run : composer update --no-interaction --no-progress
209-
210- - name : " Run tests with coverage"
211- run : bin/phpunit --color=always -v --debug --coverage-clover=build/logs/clover.xml
212-
213- - name : " Upload coverage results to Scrutinizer"
214- run : vendor/scrutinizer/ocular/bin/ocular code-coverage:upload --format=php-clover build/logs/clover.xml
215-
216- - name : " Upload coverage results to Coveralls"
217- env :
218- COVERALLS_REPO_TOKEN : ${{ secrets.GITHUB_TOKEN }}
219- run : |
220- composer global require php-coveralls/php-coveralls
221- php-coveralls --coverage_clover=build/logs/clover.xml -v
0 commit comments