-
Notifications
You must be signed in to change notification settings - Fork 48
126 lines (111 loc) · 4.81 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
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 }}${{ matrix.symfony != '' && format(', Symfony {0}', matrix.symfony) || '' }}${{ matrix.currency-bundle != '' && format(', CurrencyBundle {0}', matrix.currency-bundle) || '' }}${{ matrix.postgres != '' && format(', PostgresSQL {0}', matrix.postgres) || '' }}"
strategy:
fail-fast: false
matrix:
php: ["8.1", "8.2", "8.3"]
postgres: [""]
symfony: ["^5.4", "^6.4"]
include:
-
php: 8.1
symfony: "^5.4"
postgres: "13.3"
-
php: 8.1
symfony: "^5.4"
postgres: "14.0"
-
php: 8.3
symfony: "^7.0"
steps:
-
uses: actions/checkout@v2
-
name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php }}"
coverage: none
-
name: Setup PostgresSQL
if: matrix.postgres != ''
uses: harmon758/postgresql-action@v1
with:
postgresql version: "${{ matrix.postgres }}"
postgresql password: "postgres"
-
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: Require sylius/currency-bundle
if: matrix.currency-bundle != ''
run: |
composer require "sylius/currency-bundle:${{ matrix.currency-bundle }}" --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:drop --force -n)
(cd tests/Application && bin/console doctrine:database:create)
(cd tests/Application && bin/console doctrine:schema:create)
-
name: Run analysis
run: |
composer analyse
(cd src/Component && composer validate --strict)
-
name: Run component tests
run: (cd src/Component && vendor/bin/phpspec run)
-
name: Run lint container
run: (cd tests/Application && bin/console lint:container)
-
name: Run tests for grids with php config
run: |
(cd tests/Application && bin/console cache:clear --env=test_grids_with_php_config)
composer test-php-config
-
name: Run tests for grids with yaml config
run: |
(cd tests/Application && bin/console cache:clear --env=test_grids_with_yaml_config)
composer test-yaml-config
-
name: Run tests with grids as services
run: |
(cd tests/Application && bin/console cache:clear --env=test_grids_as_service)
composer test-with-grids-as-service
-
name: Run tests with PostgresSQL
if: matrix.postgres != ''
run: |
(cd tests/Application && bin/console cache:clear --env=test_with_postgres)
(cd tests/Application && bin/console doctrine:database:create --env=test_with_postgres)
(cd tests/Application && bin/console doctrine:schema:create --env=test_with_postgres)
composer test-with-postgres
-
name: Run lint container without maker bundle
run: |
APP_ENV=test_without_maker composer remove --dev symfony/maker-bundle
(cd tests/Application && bin/console lint:container --env=test_without_maker)