-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (50 loc) · 1.56 KB
/
phpunit.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
# run application tests with phpunit
name: PHPUnit Tests
on:
push:
branches:
- main
- dev
jobs:
phpunit:
name: Run PHPUnit
runs-on: ubuntu-latest
# define mysql service
services:
mysql:
image: mysql:latest
env:
MYSQL_ROOT_PASSWORD: root
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- name: Checkout repository
uses: actions/checkout@v2
# setup php interpreter
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.4
extensions: intl, pdo_mysql, gd
# install backend dependencies with composer
- name: Install backend dependencies
run: composer install --no-interaction --no-progress
# install frontend dependencies with npm
- name: Install frontend dependencies
run: npm install --loglevel=error
# build frontend assets
- name: Build assets
run: npm run build
# create database
- name: Create database
run: php bin/console doctrine:database:create --if-not-exists --env=test
# migrate database
- 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
# run tests
- name: Run PHPUnit
run: php bin/phpunit