-
Notifications
You must be signed in to change notification settings - Fork 107
110 lines (87 loc) · 3.2 KB
/
tests.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
name: "Tests"
concurrency:
group: "tests-${{ github.head_ref || github.run_id }}"
cancel-in-progress: true
on:
pull_request:
push:
branches: [master]
jobs:
tests:
name: "PHP ${{ matrix.php }} | PostgreSQL ${{ matrix.postgresql }}"
runs-on: "ubuntu-latest"
container:
image: "php:${{ matrix.php-version }}-cli-alpine"
env:
DATABASE_URL: "postgresql://main:main@postgresql:5432/main?serverVersion=${{ matrix.postgresql }}&charset=utf8"
services:
postgresql:
image: "postgres:${{ matrix.postgresql-version }}-alpine"
env:
POSTGRES_USER: main
POSTGRES_PASSWORD: main
POSTGRES_DB: main
strategy:
fail-fast: false
matrix:
php:
- "7.4"
- "8.0"
postgresql:
- "11"
include:
- php: "7.4"
php-version: "7.4.1"
- php: "8.0"
php-version: "8.0.30"
- postgresql: "11"
postgresql-version: "11.7"
steps:
- name: "Install OS dependencies"
run: "apk add --no-cache bash git icu-dev libzip-dev unzip zip"
- name: "Adjust allowed PHP memory"
run: echo 'memory_limit = -1' > $PHP_INI_DIR/conf.d/memory-limit.ini;
- name: "Install PHP extensions"
shell: bash
run: |
wget https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions --quiet -O /usr/local/bin/install-php-extensions
chmod +x /usr/local/bin/install-php-extensions
install-php-extensions intl pdo_pgsql zip
- name: "Install composer"
run: curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer --version=2.6.6
- name: "Checkout"
uses: "actions/checkout@v4"
with:
ref: ${{ github.event.pull_request.head.ref || '' }}
show-progress: false
- name: "Install composer dependencies"
uses: "ramsey/composer-install@v2"
- name: "Validate composer dependencies"
run: "composer validate"
- name: "Run composer audit"
run: "composer audit --no-dev --locked"
- name: "Check code style"
run: "composer check-cs"
- name: "Run PHPStan"
run: "composer phpstan"
- name: "Lint twig"
run: "bin/console lint:twig templates --show-deprecations"
- name: "Run migrations"
run: "bin/console doctrine:migrations:migrate --no-interaction"
- name: "Setup messenger transports"
run: "bin/console messenger:setup-transports"
- name: "Validate database schema"
run: "bin/console doctrine:schema:validate"
- name: "Set git committer info"
shell: bash
run: |
git config --global user.name "${GITHUB_ACTOR}"
git config --global user.email "${GITHUB_ACTOR_ID}+${GITHUB_ACTOR}@users.noreply.github.com"
- name: "Run unit tests"
run: "composer phpunit:unit"
- name: "Run integration tests"
run: "composer phpunit:integration"
- name: "Run functional tests"
run: "composer phpunit:functional"
- name: "Warmup prod cache"
run: "bin/console cache:warmup --env=prod"