-
Notifications
You must be signed in to change notification settings - Fork 315
62 lines (55 loc) · 1.84 KB
/
Copy pathphpunit.yaml
File metadata and controls
62 lines (55 loc) · 1.84 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
name: Tests
on:
push:
pull_request:
branches:
- 'master'
- 'beta'
- 'alpha'
permissions:
contents: read
jobs:
phpunit:
name: PHP Unit
runs-on: ubuntu-latest
strategy:
matrix:
php-version: ['7.4', '8.2']
services:
mariadb:
image: mariadb:10.6
env:
MARIADB_ALLOW_EMPTY_ROOT_PASSWORD: 1
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '${{ matrix.php-version }}'
extensions: json pdo_mysql curl gd imap xml opcache soap xml zip ssh2 mbstring ldap yaml snmp pcov
coverage: none
- name: Install dependencies
run: composer install --prefer-dist --no-progress --optimize-autoloader
# Setup cache directory
- name: Setup cache directory
run: |
mkdir -p /tmp/jeedom/cache
chmod 774 /tmp/jeedom
chmod 774 /tmp/jeedom/cache
# Initialize configuration
- name: Initialize configuration
run: |
cp core/config/common.config.sample.php core/config/common.config.php
sed -i 's/#HOST#/127.0.0.1/g' core/config/common.config.php
sed -i 's/#PORT#/3306/g' core/config/common.config.php
sed -i 's/#DBNAME#/jeedom/g' core/config/common.config.php
sed -i 's/#USERNAME#/root/g' core/config/common.config.php
sed -i 's/#PASSWORD#/root/g' core/config/common.config.php
# Run Legacy test suite
- name: Run legacy test suite
env:
DATABASE_DSN: mysql://root:root@localhost:3306/jeedom_test
run: vendor/bin/phpunit --coverage-text --colors=never --testsuite "Legacy tests"