Skip to content

fix: resolve merge conflict in .gitignore (#107) #43

fix: resolve merge conflict in .gitignore (#107)

fix: resolve merge conflict in .gitignore (#107) #43

Workflow file for this run

name: Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: blogware_test
MYSQL_USER: blogwareuser
MYSQL_PASSWORD: userblogware
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=5
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
extensions: pdo, pdo_mysql
- name: Install dependencies
run: composer install --no-interaction --prefer-dist
- name: Setup test database
run: |
mysql -h 127.0.0.1 -u root -proot -e "CREATE DATABASE IF NOT EXISTS blogware_test;"
php -r '
require "src/install/include/dbtable.php";
$tables = get_table_definitions("");
$pdo = new PDO("mysql:host=127.0.0.1;dbname=blogware_test", "root", "root");
// Only create tables (first 14 items are table definitions)
$tableKeys = [
"tblUser", "tblUserToken", "tblLoginAttempt", "tblPost", "tblMedia",
"tblMediaMeta", "tblMediaDownload", "tblTopic", "tblPostTopic", "tblComment",
"tblMenu", "tblPlugin", "tblSetting", "tblTheme", "tblConsents",
"tblDataRequests", "tblPrivacyLogs", "tblLanguage", "tblTranslation",
"tblDownloadLog", "tblPrivacyPolicy"
];
foreach ($tableKeys as $key) {
if (isset($tables[$key])) {
$pdo->exec($tables[$key]);
}
}
echo "Tables created\n";
'
- name: Run PHPUnit
run: vendor/bin/phpunit tests/unit tests/service tests/integration --testdox --colors=never