-
-
Notifications
You must be signed in to change notification settings - Fork 21
113 lines (109 loc) · 4.01 KB
/
ci.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
name: CI
on:
push:
paths-ignore:
- 'docker/**'
pull_request:
paths-ignore:
- 'docker/**'
env:
COMPOSER_ALLOW_SUPERUSER: '1'
SYMFONY_DEPRECATIONS_HELPER: max[self]=0
ADMIN_LOGIN: admin
ADMIN_PASSWORD: test
DATABASE_URL: mysql://user:password@mysql:3306/test_db
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
container:
image: php:8.2-alpine
options: >-
--tmpfs /tmp:exec
--tmpfs /var/tmp:exec
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install GD PHP extension
run: |
apk add $PHPIZE_DEPS libpng-dev
docker-php-ext-configure gd
docker-php-ext-install gd
- name: Install Composer
run: wget -qO - https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer --quiet
- name: Cache Composer dependencies
uses: actions/cache@v3
with:
path: ~/.composer/cache
key: composer-php${{ matrix.php }}-highest-
restore-keys: |
composer-php${{ matrix.php }}-highest-
composer-
- name: Validate Composer
run: composer validate
- name: Install highest dependencies with Composer
run: composer update --no-progress --ansi
- name: Analyze
run: PHP_CS_FIXER_IGNORE_ENV=True vendor/bin/php-cs-fixer fix --ansi
phpunit:
name: PHPUnit (PHP ${{ matrix.php }} Deps ${{ matrix.dependencies }})
runs-on: ubuntu-latest
container:
image: php:${{ matrix.php }}-alpine
options: >-
--tmpfs /tmp:exec
--tmpfs /var/tmp:exec
services:
mysql:
image: mariadb:10.7
env:
MYSQL_DATABASE: test_db
MYSQL_USER: user
MYSQL_PASSWORD: password
MYSQL_ROOT_PASSWORD: root
options: >-
--health-cmd "mysqladmin ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 3306:3306
strategy:
matrix:
php:
- '8.0'
- '8.1'
- '8.2'
dependencies:
- lowest
- highest
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install MySQL / GD PHP extensions
run: |
apk add $PHPIZE_DEPS icu-libs icu-dev libpng-dev
docker-php-ext-configure intl
docker-php-ext-configure gd
docker-php-ext-install pdo pdo_mysql intl gd
- name: Install Composer
run: wget -qO - https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer --quiet
- name: Cache Composer dependencies
uses: actions/cache@v3
with:
path: ~/.composer/cache
key: composer-php${{ matrix.php }}-${{ matrix.dependencies }}-
restore-keys: |
composer-php${{ matrix.php }}-${{ matrix.dependencies }}-
composer-
- name: Install lowest dependencies with Composer
if: matrix.dependencies == 'lowest'
run: composer update --no-progress --prefer-stable --prefer-lowest --ansi
- name: Install highest dependencies with Composer
if: matrix.dependencies == 'highest'
run: composer update --no-progress --ansi
- name: Migrate database
run: bin/console doctrine:schema:update --force --no-interaction
- name: Run tests with PHPUnit
run: vendor/bin/phpunit --process-isolation --colors=always