-
Notifications
You must be signed in to change notification settings - Fork 32
110 lines (104 loc) · 2.79 KB
/
ci.yml
File metadata and controls
110 lines (104 loc) · 2.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: CI
on:
push:
branches: [ "master" ]
pull_request:
jobs:
tests-sqlite:
name: Tests (sqlite)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: shivammathur/setup-php@v2
with:
php-version: '8.5'
extensions: pdo_sqlite
- uses: ramsey/composer-install@v3
- run: composer phpunit
env:
DB_DRIVER: sqlite
tests-mysql:
name: Tests (mysql)
runs-on: ubuntu-latest
services:
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: test
MYSQL_DATABASE: relational_test
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping -h 127.0.0.1 -uroot -ptest"
--health-interval=5s
--health-timeout=5s
--health-retries=20
steps:
- uses: actions/checkout@v6
- uses: shivammathur/setup-php@v2
with:
php-version: '8.5'
extensions: pdo_mysql
- uses: ramsey/composer-install@v3
- run: composer phpunit
env:
DB_DRIVER: mysql
DB_DSN: mysql:host=127.0.0.1;port=3306;dbname=relational_test
DB_USER: root
DB_PASSWORD: test
tests-pgsql:
name: Tests (pgsql)
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_PASSWORD: test
POSTGRES_DB: relational_test
ports:
- 5432:5432
options: >-
--health-cmd="pg_isready -U postgres -d relational_test"
--health-interval=5s
--health-timeout=5s
--health-retries=20
steps:
- uses: actions/checkout@v6
- uses: shivammathur/setup-php@v2
with:
php-version: '8.5'
extensions: pdo_pgsql
- uses: ramsey/composer-install@v3
- run: composer phpunit
env:
DB_DRIVER: pgsql
DB_DSN: pgsql:host=127.0.0.1;port=5432;dbname=relational_test
DB_USER: postgres
DB_PASSWORD: test
code-coverage:
name: Code Coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: shivammathur/setup-php@v2
with:
php-version: '8.5'
coverage: pcov
- uses: ramsey/composer-install@v3
- name: Generate coverage report
run: vendor/bin/phpunit --coverage-clover=coverage.xml
- name: Upload to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
static-analysis:
name: Static Analysis
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: shivammathur/setup-php@v2
with:
php-version: '8.5'
- uses: ramsey/composer-install@v3
- run: composer phpcs
- run: composer phpstan