Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/add plugin bc test #2902

Open
wants to merge 17 commits into
base: alpha
Choose a base branch
from
Open
1 change: 1 addition & 0 deletions .env.test
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DATABASE_DSN=mysql://root:[email protected]:3306/jeedom_test
42 changes: 42 additions & 0 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
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:
MYSQL_ROOT_PASSWORD: root
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: composer install --prefer-dist --no-progress --optimize-autoloader
- 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: Run test suite
env:
DATABASE_DSN: mysql://root:root@localhost:3306/jeedom_test
run: composer run-script test
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ Thumbs.db
.vscode
ui
composer.lock
.env
.env.local
.phpunit.result.cache
var

test.php
core/config/common.config.php
Expand Down
11 changes: 11 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,16 @@
"allow-plugins": {
"php-http/discovery": true
}
},
"require-dev": {
"phpunit/phpunit": "^9.6"
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"scripts": {
"test": "phpunit --coverage-text --colors=never"
}
}
Loading