-
Notifications
You must be signed in to change notification settings - Fork 4
156 lines (123 loc) · 7.03 KB
/
ci.yaml
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
name: Continuous Integration
on:
pull_request:
paths-ignore:
- "*.md"
workflow_dispatch: ~
workflow_call: ~
jobs:
static-checks:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: [ "8.1", "8.2", "8.3" ]
postgres: ["14.6"]
symfony: [ "^6.4", "^7.0" ]
exclude:
- php: "8.1"
symfony: "^7.0"
name: "PHP ${{ matrix.php }} / Symfony ${{ matrix.symfony }}"
env:
APP_ENV: test
DATABASE_URL: "pgsql://postgres:[email protected]/sylius_stack?charset=utf8&serverVersion=${{ matrix.postgres }}"
steps:
- name: "Checkout"
uses: actions/checkout@v3
- name: "Setup PHP"
uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php }}"
tools: symfony
coverage: none
- name: Shutdown default MySQL
run: sudo service mysql stop
- name: Setup PostgreSQL
uses: harmon758/postgresql-action@v1
with:
postgresql version: "${{ matrix.postgres }}"
postgresql password: "postgres"
- name: "Restrict packages' versions"
run: |
composer global config --no-plugins allow-plugins.symfony/flex true
composer global require --no-progress --no-scripts --no-plugins "symfony/flex"
composer config extra.symfony.require "${{ matrix.symfony }}"
- name: Get Composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: "Setup cache"
uses: actions/cache@v3
with:
path: |
${{ steps.composer-cache.outputs.dir }}
key: ${{ github.run_id }}-${{ runner.os }}-${{ hashFiles('composer.json') }}-symfony-${{ matrix.symfony }}
- name: "Install dependencies"
run: composer update --no-interaction --no-scripts
- name: "Validate composer.json"
run: composer validate --strict --no-check-version
- name: "Check for security vulnerabilities"
run: symfony security:check
- name: "Validate coding standard"
run: vendor/bin/ecs check
- name: "Validate Container"
run: bin/console lint:container
- name: Validate Package versions
run: vendor/bin/monorepo-builder validate
- name: Run PHPStan
run: vendor/bin/phpstan analyse
- name: Create Testing database
run: |
bin/console doctrine:database:create
bin/console doctrine:schema:create
- name: Run PHPUnit
run: vendor/bin/phpunit
- name: "Restrict packages' versions (Admin Ui)"
run: |
(cd src/AdminUi/ && composer global config --no-plugins allow-plugins.symfony/flex true)
(cd src/AdminUi/ && composer global config --no-plugins allow-plugins.symfony/runtime true)
(cd src/AdminUi/ && composer global require --no-progress --no-scripts --no-plugins "symfony/flex")
(cd src/AdminUi/ && composer config extra.symfony.require "${{ matrix.symfony }}")
- name: "Install dependencies (Admin Ui)"
run: (cd src/AdminUi/ && composer update --no-interaction --no-scripts)
- name: Run PHPUnit (Admin Ui)
run: (cd src/AdminUi/ && vendor/bin/phpunit)
- name: "Restrict packages' versions (Bootstrap Admin Ui)"
run: |
(cd src/BootstrapAdminUi/ && composer global config --no-plugins allow-plugins.symfony/flex true)
(cd src/BootstrapAdminUi/ && composer global config --no-plugins allow-plugins.symfony/runtime true)
(cd src/BootstrapAdminUi/ && composer global require --no-progress --no-scripts --no-plugins "symfony/flex")
(cd src/BootstrapAdminUi/ && composer config extra.symfony.require "${{ matrix.symfony }}")
- name: "Install dependencies (Bootstrap Admin Ui)"
run: (cd src/BootstrapAdminUi/ && composer update --no-interaction --no-scripts)
- name: Run PHPUnit (Bootstrap Admin Ui)
run: (cd src/BootstrapAdminUi/ && vendor/bin/phpunit)
- name: "Restrict packages' versions (Twig Hooks)"
run: |
(cd src/TwigHooks/ && composer global config --no-plugins allow-plugins.symfony/flex true)
(cd src/TwigHooks/ && composer global config --no-plugins allow-plugins.symfony/runtime true)
(cd src/TwigHooks/ && composer global require --no-progress --no-scripts --no-plugins "symfony/flex")
(cd src/TwigHooks/ && composer config extra.symfony.require "${{ matrix.symfony }}")
- name: "Install dependencies (Twig Hooks)"
run: (cd src/TwigHooks/ && composer update --no-interaction --no-scripts)
- name: Run PHPUnit (Twig Hooks)
run: (cd src/TwigHooks/ && vendor/bin/phpunit)
- name: "Restrict packages' versions (Twig Extra)"
run: |
(cd src/TwigExtra/ && composer global config --no-plugins allow-plugins.symfony/flex true)
(cd src/TwigExtra/ && composer global config --no-plugins allow-plugins.symfony/runtime true)
(cd src/TwigExtra/ && composer global require --no-progress --no-scripts --no-plugins "symfony/flex")
(cd src/TwigExtra/ && composer config extra.symfony.require "${{ matrix.symfony }}")
- name: "Install dependencies (Twig Extra)"
run: (cd src/TwigExtra/ && composer update --no-interaction --no-scripts)
- name: Run PHPUnit (Twig Extra)
run: (cd src/TwigExtra/ && vendor/bin/phpunit)
- name: "Restrict packages' versions (Ui Translations)"
run: |
(cd src/UiTranslations/ && composer global config --no-plugins allow-plugins.symfony/flex true)
(cd src/UiTranslations/ && composer global config --no-plugins allow-plugins.symfony/runtime true)
(cd src/UiTranslations/ && composer global require --no-progress --no-scripts --no-plugins "symfony/flex")
(cd src/UiTranslations/ && composer config extra.symfony.require "${{ matrix.symfony }}")
- name: "Install dependencies (Ui Translations)"
run: (cd src/UiTranslations/ && composer update --no-interaction --no-scripts)
- name: Run PHPUnit (Ui Translations)
run: (cd src/UiTranslations/ && vendor/bin/phpunit)