-
Notifications
You must be signed in to change notification settings - Fork 1
65 lines (53 loc) · 1.68 KB
/
phpunit.yml
File metadata and controls
65 lines (53 loc) · 1.68 KB
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
# run application tests with phpunit
name: PHPUnit Tests
on:
push:
branches:
- main
- dev
jobs:
phpunit:
name: Run PHPUnit
runs-on: ubuntu-latest
services:
# mysql database service
mysql:
image: mysql:8.0.43
env:
MYSQL_ROOT_PASSWORD: root
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
# redis cache service
redis:
image: redis:latest
ports:
- 6379:6379
options: --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- name: Checkout repository
uses: actions/checkout@v2
# setup php interpreter
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.5
extensions: intl, pdo_mysql, pdo
# composer install
- name: Install dependencies
run: composer install --no-interaction --no-progress --no-suggest
# create test database
- name: Create database
run: php bin/console doctrine:database:create --if-not-exists --env=test
# migrate database to latest version
- name: Migrate database
run: php bin/console doctrine:migrations:migrate --no-interaction --env=test
# load testing datafixtures
- name: Load db datafixtures
run: php bin/console doctrine:fixtures:load --no-interaction --env=test
# generate jwk key
- name: Generate JWT keys
run: php bin/console lexik:jwt:generate-keypair
# phpunit process
- name: Run PHPUnit
run: php ./bin/phpunit