-
Notifications
You must be signed in to change notification settings - Fork 155
182 lines (158 loc) · 8.48 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
name: Build
on:
push: ~
pull_request: ~
release:
types: [created]
schedule:
-
cron: "0 1 * * 6" # Run at 1am every Saturday
workflow_dispatch: ~
jobs:
tests:
runs-on: ubuntu-latest
name: "PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, Twig ${{ matrix.twig }}, Persistence: ${{ matrix.persistence }}, Collections: ${{ matrix.collections }}"
strategy:
fail-fast: false
matrix:
php: ["8.0", "8.1", "8.2"]
pagerfanta: [""]
symfony: ["^5.4", "~6.0.0", "~6.1.0", "~6.2.0"]
twig: ["^2.12", "^3.0"]
persistence: ["^2.0", "^3.0"]
collections: ["^1.8", "^2.0"]
include:
- php: "8.0"
pagerfanta: "^3.7"
symfony: "^5.4"
exclude:
- php: "8.0"
symfony: "~6.1.0"
- php: "8.0"
symfony: "~6.2.0"
- php: "8.0"
collections: "^2.0"
- php: "8.1"
collections: "^2.0"
persistence: "^2.0"
- php: "8.2"
collections: "^2.0"
persistence: "^2.0"
steps:
-
uses: actions/checkout@v2
-
name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php }}"
coverage: none
-
name: Restrict Symfony version
if: matrix.symfony != ''
run: |
composer global config --no-plugins allow-plugins.symfony/flex true
composer global require --no-progress --no-scripts --no-plugins "symfony/flex:^1.10"
composer config extra.symfony.require "${{ matrix.symfony }}"
(cd src/Component && composer config extra.symfony.require "${{ matrix.symfony }}")
-
name: Restrict Pagerfanta version
if: matrix.pagerfanta != ''
run: |
composer require "babdev/pagerfanta-bundle:${{ matrix.pagerfanta }}" --no-update --no-scripts
composer require "pagerfanta/pagerfanta:${{ matrix.pagerfanta }}" --dev --no-update --no-scripts
(cd src/Component && composer require "pagerfanta/core:${{ matrix.pagerfanta }}" --no-update --no-scripts)
-
name: Restrict twig/twig version
if: matrix.twig != ''
run: composer require "twig/twig:${{ matrix.twig }}" --no-update --no-scripts
-
name: Restrict doctrine/persistence version
if: matrix.persistence != ''
run: composer require "doctrine/persistence:${{ matrix.persistence }}" --no-update --no-scripts
-
name: Restrict doctrine/collections version
if: matrix.collections != ''
run: composer require "doctrine/collections:${{ matrix.collections }}" --no-update --no-scripts
-
name: Install dependencies
run: |
composer update --no-scripts
(cd src/Component && composer update --no-scripts)
-
name: Prepare test application
run: |
(cd tests/Application && bin/console doctrine:database:create)
(cd tests/Application && bin/console doctrine:schema:create)
-
name: Run Psalm
run: vendor/bin/psalm --php-version=${{ matrix.php }}
-
name: Run analysis
run: |
composer analyse
(cd src/Component && composer validate --strict)
-
name: Run Phpspec tests
if: ${{ true != contains( matrix.php, '8.2' ) }}
run: |
vendor/bin/phpspec run --ansi --no-interaction
(cd src/Component && vendor/bin/phpspec run --no-interaction)
-
name: Run PHPUnit tests
run: vendor/bin/phpunit --colors=always
-
name: Run lint container
run: (cd tests/Application && bin/console lint:container)
-
name: Run state machine Phpspec tests with winzou/state-machine package
if: ${{ true != contains( matrix.php, '8.2' ) }}
run: |
sed -i -e 's/state_machine_component: symfony/state_machine_component: winzou/g' tests/Application/config/packages/test/sylius_resource.yaml
(cd tests/Application && bin/console cache:clear --env=test)
vendor/bin/phpspec run --ansi --no-interaction
sed -i -e 's/state_machine_component: winzou/state_machine_component: symfony/g' tests/Application/config/packages/test/sylius_resource.yaml
-
name: Run state machine PHPUnit tests with winzou/state-machine package
run: |
sed -i -e 's/state_machine_component: symfony/state_machine_component: winzou/g' tests/Application/config/packages/test/sylius_resource.yaml
(cd tests/Application && bin/console cache:clear --env=test)
vendor/bin/phpunit --colors=always
sed -i -e 's/state_machine_component: winzou/state_machine_component: symfony/g' tests/Application/config/packages/test/sylius_resource.yaml
-
name: Run state machine Phpspec tests with symfony/workflow package
if: ${{ true != contains( matrix.php, '8.2' ) }}
run: |
sed -i -e 's/state_machine_component: winzou/state_machine_component: symfony/g' tests/Application/config/packages/test/sylius_resource.yaml
(cd tests/Application && bin/console cache:clear --env=test)
vendor/bin/phpspec run --ansi --no-interaction
sed -i -e 's/state_machine_component: symfony/state_machine_component: winzou/g' tests/Application/config/packages/test/sylius_resource.yaml
-
name: Run state machine PHPUnit tests with symfony/workflow package
run: |
sed -i -e 's/state_machine_component: winzou/state_machine_component: symfony/g' tests/Application/config/packages/test/sylius_resource.yaml
(cd tests/Application && bin/console cache:clear --env=test)
vendor/bin/phpunit --colors=always
sed -i -e 's/state_machine_component: symfony/state_machine_component: winzou/g' tests/Application/config/packages/test/sylius_resource.yaml
-
name: Run smoke tests without friendsofsymfony/rest-bundle willdurand/hateoas-bundle jms/serializer-bundle packages
run: |
composer remove friendsofsymfony/rest-bundle willdurand/hateoas-bundle jms/serializer-bundle --no-scripts
(cd tests/Application && bin/console cache:clear --env=test_without_fosrest)
composer require friendsofsymfony/rest-bundle willdurand/hateoas-bundle jms/serializer-bundle --no-scripts
-
name: Run lint container without winzou/state-machine-bundle package
run: |
composer remove winzou/state-machine-bundle --no-scripts
(cd tests/Application && bin/console cache:clear --env=test_without_state_machine)
(cd tests/Application && bin/console lint:container --env=test_without_state_machine)
composer require winzou/state-machine-bundle --no-scripts
-
name: Run lint container without twig/twig package
run: |
composer remove symfony/twig-bundle --no-scripts
composer remove sylius/grid-bundle --no-scripts --dev
(cd tests/Application && bin/console cache:clear --env=test_without_twig)
(cd tests/Application && bin/console lint:container --env=test_without_twig)
composer require symfony/twig-bundle --no-scripts
composer require "sylius/grid-bundle: ^1.7 || v1.12.0-ALPHA.1" --no-scripts --dev