Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Integration Tests

on:
pull_request:
types: [opened, synchronize, reopened]
branches:
- develop

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true

permissions:
contents: read

jobs:
smoke-tests:
runs-on: ubuntu-latest

services:
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: librebooking_test
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping -h 127.0.0.1"
--health-interval=10s
--health-timeout=5s
--health-retries=5
steps:
- name: Checkout code
uses: actions/checkout@v6

- name: Set up PHP 8.4
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
extensions: mysqli, pdo_mysql

- name: Install Composer dependencies
uses: ramsey/composer-install@v3

- name: Load database schema
run: mysql -h 127.0.0.1 -u root -proot librebooking_test < database_schema/create-schema.sql

- name: Apply database upgrades
run: php phing-tasks/UpgradeDbTask.php root root 127.0.0.1 librebooking_test database_schema

- name: Load base data
run: mysql -h 127.0.0.1 -u root -proot librebooking_test < database_schema/create-data.sql

- name: Load sample data
run: mysql -h 127.0.0.1 -u root -proot librebooking_test < database_schema/sample-data-utf8.sql

- name: Generate test config
env:
LB_TEST_DB_HOST: '127.0.0.1'
LB_TEST_DB_PORT: '3306'
LB_TEST_DB_NAME: 'librebooking_test'
LB_TEST_DB_USER: 'root'
LB_TEST_DB_PASSWORD: 'root'
run: php tests/Integration/create-test-config.php

- name: Create template cache directory
run: mkdir -p tpl_c

- name: Run smoke tests
run: composer test:integration
6 changes: 4 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"phpcompatibility/php-compatibility": "^9.3.5",
"phpunit/phpunit": "^11.3",
"phpstan/phpstan": "^2.1",
"phpstan/phpstan-phpunit": "^2.0"
"phpstan/phpstan-phpunit": "^2.0",
"guzzlehttp/guzzle": "^7.0"
},
"require": {
"php": ">=8.2",
Expand Down Expand Up @@ -48,7 +49,8 @@
"@phpcsfixer:lint"
],
"sniffer:php8": "phpcs -p ./ --standard=vendor/phpcompatibility/php-compatibility/PHPCompatibility --report-full=./php8-report.log --ignore=./vendor/*,./tools/*,./.git/*,./tpl_c/*,./build/*,./.phpdoc/*,./var/*,./Web/scripts/*,./Web/css/* --runtime-set testVersion 8.0",
"preflight": "php lib/preflight.php"
"preflight": "php lib/preflight.php",
"test:integration": "./vendor/bin/phpunit --testsuite integration --testdox"
},
"config": {
"allow-plugins": {
Expand Down
4 changes: 2 additions & 2 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<!-- run only a specific testsuite: 'phpunit -_-testsuite <testsuite-name>' -->
<testsuite name="all">
<directory>./tests</directory>
<exclude>./tests/Integration</exclude>
</testsuite>
<testsuite name="application">
<directory>./tests/Application</directory>
Expand All @@ -28,6 +29,9 @@
<testsuite name="webservices">
<directory>./tests/WebServices</directory>
</testsuite>
<testsuite name="integration">
<directory>./tests/Integration</directory>
</testsuite>
</testsuites>
<!-- to generate coverage report: phpunit -_-coverage-html ./var/ -->
<php>
Expand Down
Loading