@@ -6,6 +6,14 @@ on: # Build any PRs and main branch changes
66 types :
77 - opened
88 - synchronize
9+ paths-ignore :
10+ # In case of updates to those workflows, they must be pre-checked by `pre-check-CI-updates.yml` rather than this workflow !
11+ # Any updates on those workflows are expected to be restricted to those workflows only ! (no update on code for instance)
12+ - ' .github/workflows/pre-check-CI-updates.yml'
13+ - ' .github/workflows/CI.yml'
14+ - ' .github/workflows/coverage-upload.yml'
15+ - ' .github/workflows/reusable-CI-workflow.yml'
16+ - ' .github/workflows/reusable-coverage-upload-workflow.yml'
917 push :
1018 branches : [ master ]
1119 schedule :
@@ -15,220 +23,9 @@ concurrency:
1523 group : " ${{ github.workflow }}-${{ github.head_ref || github.ref }}"
1624 cancel-in-progress : true
1725
18- env :
19- TEST_OUTPUT_STYLE : pretty
20- COMPOSER_OPTIONS : --optimize-autoloader
21-
2226jobs :
2327 tests :
24- name : UTs & FTs - Symfony ${{ matrix.symfony-version }}
25- runs-on : ubuntu-latest
26- env :
27- COVERAGE_TYPE : none
28- strategy :
29- fail-fast : true
30- max-parallel : 4
31- matrix :
32- include :
33- # Bare minimum => Lowest versions allowed by composer config
34- - symfony-version : ' 4.4'
35- php-version : ' 8.0'
36- composer-flag : --prefer-lowest
37- # Up to date versions => Latest versions allowed by composer config
38- - symfony-version : ' 5.4'
39- php-version : ' 8.2'
40- # Late symfony migration => Lowest symfony version with latest minor php version allowed by composer config
41- - symfony-version : ' 4.4'
42- php-version : ' 8.2'
43- composer-flag : --prefer-lowest
44- # Late php migration => Latest symfony version with lowest minor php version allowed by composer config
45- - symfony-version : ' 5.4'
46- php-version : ' 8.0'
47- # Symfony 6.0 latest
48- - symfony-version : ' 6.0'
49- php-version : ' 8.2'
50- # Symfony 6.0 lowest
51- - symfony-version : ' 6.0'
52- php-version : ' 8.0'
53- composer-flag : --prefer-lowest
54- steps :
55- - name : Check out code
56- uses : actions/checkout@v4
57-
58- - name : Enable coverage
59- if : ${{ matrix.php-version == '8.2' }}
60- run : |
61- echo "COVERAGE_OUTPUT_STYLE=clover" >> $GITHUB_ENV
62- echo "COVERAGE_TYPE=xdebug" >> $GITHUB_ENV
63-
64- - name : Setup PHP ${{ matrix.php-version }}
65- uses : shivammathur/setup-php@v2
66- env :
67- update : true # Always use latest available patch for the version
68- fail-fast : true # step will fail if an extension or tool fails to set up
69- with :
70- php-version : ' ${{ matrix.php-version }}'
71- tools : composer
72- coverage : ${{ env.COVERAGE_TYPE }}
73-
74- - name : Setup cache
75- id : cache
76- uses : actions/cache@v4
77- with :
78- path : |
79- ~/.composer
80- ./vendor
81- # Clear the cache if composer json (as composer.lock is in the repo) has been updated
82- key : tests-${{ matrix.php-version }}-${{ matrix.symfony-version }}-${{ matrix.composer-flag }}-${{ hashFiles('composer.json') }}
83-
84- - name : Build
85- run : |
86- SF_VERSION=${{ matrix.symfony-version }}
87- # Issue with ParamterBag below 4.4.30 => https://github.com/symfony/symfony/commit/3eca446b21607ea1c7a865ece2dd8254c33679cc
88- test '${{ matrix.symfony-version }}' = '4.4' && test '${{ matrix.php-version }}' = '8.2' && SF_VERSION=4.4.30
89- composer require -W ${{ env.COMPOSER_OPTIONS }} ${{ matrix.composer-flag }} \
90- symfony/config:^$SF_VERSION \
91- symfony/dependency-injection:^$SF_VERSION \
92- symfony/http-kernel:^$SF_VERSION \
93- symfony/event-dispatcher:^$SF_VERSION \
94- symfony/framework-bundle:^$SF_VERSION \
95- symfony/routing:^$SF_VERSION \
96- && composer update ${{ env.COMPOSER_OPTIONS }} ${{ matrix.composer-flag }} \
97- && make build
98-
99- - name : Tests
100- run : make test-unit && make test-functional
101-
102- - name : Create "unit tests" reports group
103- if : ${{ env.COVERAGE_TYPE == 'xdebug' }}
104- id : unit-tests-coverage-group
105- uses : yoanm/temp-reports-group-workspace/.github/actions/create-action@develop
106- with :
107- name : unit-tests
108- format : clover
109- files : build/coverage-phpunit/unit.clover
110- flags : |
111- unit-tests
112- php-${{ matrix.php-version }}
113- sf-${{ matrix.symfony-version }}
114- path : build/coverage-groups
115-
116- - name : Create "functional tests" coverage group
117- if : ${{ env.COVERAGE_TYPE == 'xdebug' }}
118- id : functional-tests-coverage-group
119- uses : yoanm/temp-reports-group-workspace/.github/actions/create-action@develop
120- with :
121- name : functional-tests
122- format : clover
123- files : |
124- build/coverage-phpunit/functional.clover
125- build/coverage-behat/clover.xml
126- flags : |
127- functional-tests
128- php-${{ matrix.php-version }}
129- sf-${{ matrix.symfony-version }}
130- path : build/coverage-groups
131-
132- - name : Upload coverage reports
133- if : ${{ env.COVERAGE_TYPE == 'xdebug' }}
134- uses : actions/upload-artifact@v4
135- with :
136- name : coverage-groups-php${{ matrix.php-version }}-sf${{ matrix.symfony-version }}
137- path : build/coverage-groups
138- if-no-files-found : error
139-
140- static-checks :
141- name : Static checks
142- runs-on : ubuntu-latest
143- steps :
144- - uses : actions/checkout@v4
145-
146- - name : Setup PHP 8.2
147- uses : shivammathur/setup-php@v2
148- with :
149- php-version : 8.2 # Latest supported
150- tools : composer
151- coverage : none
152- env :
153- # Always use latest available patch for the version
154- update : true
155-
156- - name : Setup cache
157- id : cache
158- uses : actions/cache@v4
159- with :
160- path : |
161- ~/.composer
162- # Clear the cache if composer json (as composer.lock is in the repo) has been updated
163- key : tests-${{ env.PHP_VERSION }}-${{ hashFiles('composer.json') }}
164-
165- - name : Build
166- run : make build
167-
168- - name : ComposerRequireChecker
169- uses : docker://webfactory/composer-require-checker:4.5.0
170-
171- - name : Dependencies check
172- if : ${{ github.event_name == 'pull_request' }}
173- uses : actions/dependency-review-action@v4
174-
175- nightly-tests :
176- name : Nightly - Symfony ${{ matrix.symfony-version }}
177- runs-on : ubuntu-latest
178- env :
179- COMPOSER_OPTIONS : ' --optimize-autoloader --ignore-platform-req=php+'
180- continue-on-error : true
181- needs : [ static-checks, tests ]
182- strategy :
183- fail-fast : false
184- max-parallel : 4
185- matrix :
186- php-version :
187- - ' 8.3' # Current php dev version
188- symfony-version :
189- - ' 4.4' # Lowest LTS
190- - ' 5.4' # Latest LTS
191- - ' 6.0' # Current major version
192- include :
193- - symfony-version : ' 6.3' # Next symfony minor version to manage with latest supported PHP version
194- php-version : ' 8.2'
195-
196- steps :
197- - name : Check out code
198- uses : actions/checkout@v4
199-
200- - name : Setup PHP ${{ matrix.php-version }}
201- uses : shivammathur/setup-php@v2
202- with :
203- php-version : ' ${{ matrix.php-version }}'
204- tools : composer
205- coverage : none
206- env :
207- # Always use latest available patch for the version
208- update : true
209-
210- - name : Setup cache
211- id : cache
212- uses : actions/cache@v4
213- with :
214- path : |
215- ~/.composer
216- ./vendor
217- # Clear the cache if composer json (as composer.lock is in the repo) has been updated
218- key : tests-${{ matrix.php-version }}-${{ matrix.symfony-version }}-${{ hashFiles('composer.json') }}
219-
220- - name : Build
221- run : |
222- composer config minimum-stability dev \
223- && composer require -W ${{ env.COMPOSER_OPTIONS }} \
224- symfony/config:^${{ matrix.symfony-version }} \
225- symfony/dependency-injection:^${{ matrix.symfony-version }} \
226- symfony/http-kernel:^${{ matrix.symfony-version }} \
227- symfony/event-dispatcher:^${{ matrix.symfony-version }} \
228- symfony/framework-bundle:^${{ matrix.symfony-version }} \
229- symfony/routing:^${{ matrix.symfony-version }} \
230- && composer update ${{ env.COMPOSER_OPTIONS }} \
231- && make build
232-
233- - name : Test
234- run : make test-unit && make test-functional
28+ name : Tests
29+ permissions :
30+ contents : read
31+ uses : ./.github/workflows/reusable-CI-workflow.yml
0 commit comments