Skip to content

Commit 8d58df6

Browse files
committed
Use GitHub Actions.
1 parent ee71d46 commit 8d58df6

File tree

5 files changed

+80
-61
lines changed

5 files changed

+80
-61
lines changed

.gitattributes

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
/.gitattributes export-ignore
2-
/.gitignore export-ignore
3-
/.scrutinizer.yml export-ignore
4-
/.travis.yml export-ignore
5-
/build.xml export-ignore
6-
/phpunit.xml export-ignore
7-
/README.md export-ignore
8-
/test/ export-ignore
1+
/.gitattributes export-ignore
2+
/.gitignore export-ignore
3+
/build.xml export-ignore
4+
/phpunit.xml export-ignore
5+
/README.md export-ignore
6+
/test/ export-ignore

.github/workflows/unit.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
on:
2+
- "pull_request"
3+
- "push"
4+
5+
name: "unit"
6+
7+
permissions:
8+
contents: "read"
9+
10+
jobs:
11+
tests:
12+
name: "Tests"
13+
runs-on: "ubuntu-latest"
14+
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
php-version:
19+
- "8.1"
20+
- "8.2"
21+
- "8.3"
22+
mysql-version:
23+
- "mysql-5.7"
24+
- "mysql-8.0"
25+
- "mariadb-10.2"
26+
- "mariadb-10.3"
27+
- "mariadb-10.4"
28+
- "mariadb-10.5"
29+
- "mariadb-10.6"
30+
- "mariadb-10.7"
31+
- "mariadb-10.8"
32+
- "mariadb-10.9"
33+
34+
steps:
35+
- name: "Checkout"
36+
uses: "actions/checkout@v3"
37+
38+
- name: "Install PHP with extensions"
39+
uses: "shivammathur/setup-php@v2"
40+
with:
41+
php-version: "${{ matrix.php-version }}"
42+
extensions: "xdebug"
43+
44+
- name: "Cache dependencies installed with Composer"
45+
uses: "actions/cache@v3"
46+
with:
47+
path: "~/.composer/cache"
48+
key: "php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.json') }}"
49+
restore-keys: "php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-"
50+
51+
- name: "Install dependencies with Composer"
52+
run: "composer update --no-ansi --no-interaction --no-progress"
53+
54+
- name: "Install MySQL or MariaDB"
55+
uses: "shogo82148/actions-setup-mysql@v1"
56+
with:
57+
mysql-version: "${{ matrix.mysql-version }}"
58+
59+
- name: "Install timezone info"
60+
run: "mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -h 127.0.0.1 mysql"
61+
62+
- name: "Trust function creators (for MySQL 8.x)"
63+
run: "mysql -u root -h 127.0.0.1 -e 'SET GLOBAL log_bin_trust_function_creators = 1'"
64+
65+
- name: "Run tests with PHPUnit"
66+
run: "bin/phing unit"
67+
68+
- name: "Upload to Codecov"
69+
uses: "codecov/codecov-action@v2"
70+
with:
71+
files: "test/coverage.xml"
72+
verbose: true

.scrutinizer.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

.travis.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

test/etc/stratum.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
backend = \SetBased\Stratum\MySql\Backend\MySqlBackend
33

44
[database]
5-
host = localhost
5+
host = 127.0.0.1
66
user = test
77
password = test
88
database = test
@@ -14,7 +14,7 @@ class = Plaisio\C
1414
[loader]
1515
sources = lib/psql/**/*.psql
1616
metadata = test/etc/routines.json
17-
sql_mode = STRICT_ALL_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_AUTO_VALUE_ON_ZERO,NO_ENGINE_SUBSTITUTION,NO_ZERO_DATE,NO_ZERO_IN_DATE,ONLY_FULL_GROUP_BY
17+
sql_mode = STRICT_ALL_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_VALUE_ON_ZERO,NO_ENGINE_SUBSTITUTION,NO_ZERO_DATE,NO_ZERO_IN_DATE,ONLY_FULL_GROUP_BY
1818
character_set = utf8mb4
1919
collate = utf8mb4_general_ci
2020

0 commit comments

Comments
 (0)