Skip to content

Commit 1a40239

Browse files
committed
Use GitHub Actions.
1 parent 9c25db6 commit 1a40239

File tree

6 files changed

+25
-1
lines changed

6 files changed

+25
-1
lines changed

.github/workflows/unit.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ jobs:
4040
- name: "Install dependencies with Composer"
4141
run: "composer update --no-ansi --no-interaction --no-progress"
4242

43+
- name: "Install MariaDB"
44+
uses: "shogo82148/actions-setup-mysql@v1"
45+
with:
46+
mysql-version: "mariadb-10.4"
47+
4348
- name: "Run tests with PHPUnit"
4449
run: "bin/phing unit"
4550

build.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@
2121

2222
<!-- Runs all unit tests -->
2323
<target name="unit">
24+
<exec executable="bash" passthru="true" checkreturn="true">
25+
<arg value="-e"/>
26+
<arg value="-x"/>
27+
<arg value="test/unit-test.sh"/>
28+
</exec>
2429
<move file="test/psql/rename" tofile="test/psql/ test_escape ' &quot; @ $ ! ." overwrite="true" haltonerror="false"/>
2530
<exec executable="bin/phpunit" passthru="true" checkreturn="true"/>
2631
<move file="test/psql/ test_escape ' &quot; @ $ ! ." tofile="test/psql/rename" overwrite="true"/>

test/InitTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public function testPdo(): void
138138
*/
139139
public function testPdoMySql(): void
140140
{
141-
$pdo = new \PDO('mysql:hosts=localhost;dbname=test', 'test', 'test');
141+
$pdo = new \PDO('mysql:host=127.0.0.1;dbname=test', 'test', 'test');
142142

143143
$this->expectException(\InvalidArgumentException::class);
144144
new SqlitePdoDataLayer($pdo);
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
drop database if exists test;
2+
3+
create database test default character set utf8;
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
drop user if exists 'test'@'127.0.0.1';
2+
3+
create user 'test'@'127.0.0.1' identified by 'test';
4+
5+
grant all on test.* to 'test'@'127.0.0.1';

test/unit-test.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash -e -x
2+
3+
exec 2>&1
4+
5+
mysql -v -uroot -h127.0.0.1 < test/ddl/mysql/0010_create_database.sql
6+
mysql -v -uroot -h127.0.0.1 < test/ddl/mysql/0020_create_user.sql

0 commit comments

Comments
 (0)