Skip to content

Commit d756ab9

Browse files
committed
Use GitHub Actions.
1 parent a14551c commit d756ab9

File tree

1 file changed

+72
-0
lines changed

1 file changed

+72
-0
lines changed

.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

0 commit comments

Comments
 (0)