-
Notifications
You must be signed in to change notification settings - Fork 3
89 lines (74 loc) · 2.19 KB
/
Copy pathtests.yml
File metadata and controls
89 lines (74 loc) · 2.19 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
name: Tests
on:
push:
branches: [master, main]
pull_request:
jobs:
test:
name: "PHP ${{ matrix.php }} / MySQL ${{ matrix.mysql }}"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: ["8.4", "8.5"]
mysql: ["8.0", "8.4"]
services:
mysql:
image: "mysql:${{ matrix.mysql }}"
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: dhtmlsql_test
MYSQL_USER: dhtmlsql
MYSQL_PASSWORD: secret
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping --silent"
--health-interval=10s
--health-timeout=5s
--health-retries=5
steps:
- uses: actions/checkout@v4
- name: Set up PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: mysqli
coverage: none
- name: Validate composer.json
run: composer validate --strict
- name: Cache Composer packages
uses: actions/cache@v4
with:
path: vendor
key: "${{ runner.os }}-composer-${{ hashFiles('composer.lock') }}"
restore-keys: "${{ runner.os }}-composer-"
- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-interaction
- name: Check coding style
run: composer style:check
- name: Run static analysis
run: composer analyse
- name: Run unit tests
run: composer test:unit
- name: Run integration tests
env:
DB_HOST: 127.0.0.1
DB_DATABASE: dhtmlsql_test
DB_USERNAME: dhtmlsql
DB_PASSWORD: secret
run: composer test:integration
- name: Run compatibility tests
env:
DB_HOST: 127.0.0.1
DB_DATABASE: dhtmlsql_test
DB_USERNAME: dhtmlsql
DB_PASSWORD: secret
run: composer test:compat
- name: Upload test logs on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: "test-logs-php${{ matrix.php }}-mysql${{ matrix.mysql }}"
path: |
.phpunit.result.cache