-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (74 loc) · 2.98 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
name: CI
on:
push:
branches: [master, dev]
pull_request:
branches: [master, dev]
workflow_call:
jobs:
php:
runs-on: ubuntu-latest
strategy:
fail-fast: true
services:
database:
image: postgres:16.4-alpine
ports:
- 5432:5432
env:
POSTGRES_HOST: localhost
POSTGRES_USER: user
POSTGRES_PASSWORD: password
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "8.3"
extensions: mbstring, xml, ctype, iconv, intl, pdo, pdo_mysql, dom, filter, gd, json, opcache, zip, pcov
env:
update: true
- name: Check php version
run: php -v
- name: Validate composer.json and composer.lock
run: composer validate
- name: Copy test files
run: |
mv .github/.env.test .env
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
- name: Check the Symfony console
run: php bin/console about
- name: Display env variables
run: php bin/console debug:container --env-vars
- name: Run PHP static tests
run: composer run stan:github
- name: Run PHP CS tests
run: composer run cs:check
- name: Doctrine cache clear
run: php bin/console doctrine:cache:clear-metadata
- name: Drop previous database
run: php bin/console doctrine:database:drop --force --if-exists --env=test --no-interaction
- name: Create database
run: php bin/console doctrine:database:create --if-not-exists --env=test --no-interaction
- name: Load migrations
run: php bin/console doctrine:migrations:migrate --env=test --no-interaction --allow-no-migration
# - name: Validate database schema
# run: php bin/console doctrine:schema:validate --env=test --no-interaction
- name: Load fixtures
run: php bin/console doctrine:fixtures:load --env=test --no-interaction
- name: Run PHP unit tests
run: composer run test