-
-
Notifications
You must be signed in to change notification settings - Fork 155
159 lines (137 loc) · 7.38 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
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 }}, ORM ${{ matrix.orm }}"
env:
APP_ENV: ${{ matrix.app_env }}
strategy:
fail-fast: false
matrix:
orm: ['2.*', '3.*']
php: ["8.1", "8.2", "8.3"]
composer-flags: ['--no-scripts --prefer-stable --prefer-dist']
symfony: ["^6.4", "^7.1"]
app_env: ["test"]
exclude:
- php: "8.1"
symfony: "^7.1"
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 ORM version
if: matrix.orm != ''
run: |
composer require --dev doctrine/orm "${{ matrix.orm }}" --no-update --no-scripts
(cd src/Component && composer require --dev doctrine/orm "${{ matrix.orm }}" --no-update --no-scripts)
-
name: Remove hateoas on Symfony 7
if: matrix.symfony == '^7.0'
run: composer remove --dev willdurand/hateoas-bundle --no-update --no-scripts
-
name: Install dependencies
run: |
composer update ${{ matrix.composer-flags }}
(cd src/Component && composer update ${{ matrix.composer-flags }})
-
name: Prepare test application
run: |
(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
run: |
vendor/bin/phpspec run --ansi --no-interaction
(cd src/Component && vendor/bin/phpspec run --no-interaction)
(cd src/Component && vendor/bin/phpspec run --no-interaction --config legacy/phpspec.yml.dist)
-
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)
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)
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)
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)
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 lint container without friendsofsymfony/rest-bundle willdurand/hateoas-bundle jms/serializer-bundle packages
if: matrix.app_env == 'test'
run: |
composer remove --dev friendsofsymfony/rest-bundle willdurand/hateoas-bundle jms/serializer-bundle --no-scripts
(cd tests/Application && bin/console cache:clear --env=test_without_fosrest)
(cd tests/Application && bin/console lint:container --env=test_without_fosrest)
composer require --dev friendsofsymfony/rest-bundle willdurand/hateoas-bundle jms/serializer-bundle --no-scripts
-
name: Run lint container without winzou/state-machine-bundle package
if: matrix.app_env == 'test'
run: |
composer remove --dev 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 sylius/grid-bundle package
if: matrix.app_env == 'test'
run: |
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 "sylius/grid-bundle: ^1.11" --no-scripts --dev