Skip to content

Commit bafbcde

Browse files
committed
Add github CI workflows.
1 parent e93b64a commit bafbcde

File tree

1 file changed

+80
-0
lines changed

1 file changed

+80
-0
lines changed

.github/workflows/ci.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: CI
2+
3+
on: [push]
4+
5+
jobs:
6+
phpstan:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- uses: actions/checkout@v3
11+
12+
- name: Cache Composer dependencies
13+
uses: actions/cache@v3
14+
with:
15+
path: /tmp/composer-cache
16+
key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }}
17+
18+
- uses: php-actions/composer@v6
19+
with:
20+
php_version: 8.2
21+
22+
- uses: php-actions/phpstan@v3
23+
with:
24+
php_version: 8.2
25+
path: src/
26+
version: composer
27+
configuration: phpstan.neon
28+
command: analyse
29+
30+
phpunit:
31+
runs-on: ubuntu-latest
32+
33+
services:
34+
mysql:
35+
image: mariadb:10.11
36+
env:
37+
MARIADB_DATABASE: kbpdb
38+
MARIADB_USER: kbpdb
39+
MARIADB_PASSWORD: password
40+
options: >-
41+
--health-cmd "mysqladmin ping"
42+
--health-interval 10s
43+
--health-timeout 5s
44+
--health-retries 5
45+
ports:
46+
- 3306:3306
47+
48+
postgres:
49+
image: postgres:15
50+
env:
51+
POSTGRES_PASSWORD: password
52+
options: >-
53+
--health-cmd "pg_isready"
54+
--health-interval 10s
55+
--health-timeout 5s
56+
--health-retries 5
57+
ports:
58+
- 5432:5432
59+
60+
steps:
61+
- uses: actions/checkout@v3
62+
63+
- name: Cache Composer dependencies
64+
uses: actions/cache@v3
65+
with:
66+
path: /tmp/composer-cache
67+
key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }}
68+
69+
- uses: php-actions/composer@v6
70+
with:
71+
php_version: 8.2
72+
73+
- uses: php-actions/phpunit@v4
74+
with:
75+
php_version: 8.2
76+
php_extensions: "pcntl intl pdo_mysql pdo_pgsql"
77+
version: composer
78+
configuration: phpunit.xml
79+
args: '--testdox'
80+

0 commit comments

Comments
 (0)