60 lines
1.4 KiB
YAML
60 lines
1.4 KiB
YAML
name: Tests
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- develop
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
phpunit:
|
|
name: PHPUnit
|
|
runs-on: ubuntu-latest
|
|
|
|
services:
|
|
mysql:
|
|
image: mariadb:10.11
|
|
env:
|
|
MYSQL_ROOT_PASSWORD: root
|
|
MYSQL_DATABASE: alrahma_test
|
|
MYSQL_USER: alrahma
|
|
MYSQL_PASSWORD: alrahma
|
|
ports:
|
|
- 3306:3306
|
|
options: >-
|
|
--health-cmd="mariadb-admin ping -h 127.0.0.1 -uroot -proot"
|
|
--health-interval=10s
|
|
--health-timeout=5s
|
|
--health-retries=10
|
|
|
|
env:
|
|
CI_ENVIRONMENT: testing
|
|
database.tests.hostname: 127.0.0.1
|
|
database.tests.database: alrahma_test
|
|
database.tests.username: alrahma
|
|
database.tests.password: alrahma
|
|
database.tests.DBDriver: MySQLi
|
|
database.tests.DBPrefix: ''
|
|
database.tests.port: 3306
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup PHP
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: '8.2'
|
|
extensions: dom, gd, intl, mbstring, mysqli, zip
|
|
coverage: none
|
|
|
|
- name: Validate Composer config
|
|
run: composer validate --no-check-publish --strict
|
|
|
|
- name: Install dependencies
|
|
run: composer install --no-interaction --prefer-dist --no-progress
|
|
|
|
- name: Run tests
|
|
run: composer test
|