-
-
Notifications
You must be signed in to change notification settings - Fork 67
72 lines (62 loc) · 1.87 KB
/
tests.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
name: "tests"
on:
pull_request: ~
push:
branches: [main]
jobs:
run:
runs-on: ubuntu-latest
strategy:
matrix:
php-version:
- "8.1"
- "8.2"
- "8.3"
- "8.4"
dependencies:
- highest
include:
- php-version: "8.4"
dependencies: lowest
fail-fast: false
env:
SYMFONY_DEPRECATIONS_HELPER: ${{ matrix.dependencies == 'lowest' && 'disabled=1' || 'max[direct]=0' }}
services:
mysql:
image: mysql:8
ports:
- 3306:3306
options: --health-cmd "mysqladmin ping" --health-interval 10s --health-timeout 5s --health-retries 10
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: odm
postgres:
image: postgres:14
ports:
- 5432:5432
options: --health-cmd "/usr/bin/pg_isready" --health-interval 10s --health-timeout 5s --health-retries 10
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: odm
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: mbstring, xml, ctype, iconv, intl, pdo_mysql, pdo_pgsql
- name: Install dependencies
uses: ramsey/composer-install@v3
with:
dependency-versions: "${{ matrix.dependencies }}"
- name: Install PHPUnit
run: php vendor/bin/simple-phpunit install
- name: Run tests (MySQL)
env:
DATABASE_URL: mysql://root:[email protected]:3306/odm?serverVersion=8.0
run: php vendor/bin/simple-phpunit
- name: Run tests (PostgreSQL)
env:
DATABASE_URL: postgresql://postgres:[email protected]:5432/odm?serverVersion=14&charset=utf8
run: php vendor/bin/simple-phpunit