-
Notifications
You must be signed in to change notification settings - Fork 1
91 lines (74 loc) · 2.31 KB
/
ci.yaml
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
name: "Continuous Integration"
concurrency:
group: "ci-${{ github.head_ref || github.run_id }}"
cancel-in-progress: true
on:
pull_request:
push:
branches:
- "main"
env:
fail-fast: true
jobs:
tests-mysql:
name: "Integration Tests w/MySQL (PHP ${{ matrix.php-version }}, MySQL ${{ matrix.mysql-version }})"
runs-on: "ubuntu-22.04"
strategy:
matrix:
mysql-version:
- "8.0"
php-version:
- "8.2"
services:
mysql:
image: "mysql:${{ matrix.mysql-version }}"
options: >-
--health-cmd "mysqladmin ping --silent"
--health-interval=1s
--health-timeout=5s
--health-retries=90
-e MYSQL_ALLOW_EMPTY_PASSWORD=yes
-e MYSQL_DATABASE=tests
-e MYSQL_INITDB_SKIP_TZINFO=yes
--entrypoint sh mysql:8 -c "exec docker-entrypoint.sh mysqld --default-authentication-plugin=mysql_native_password"
ports:
- "3306:3306"
steps:
- name: "Checkout"
uses: "actions/checkout@v3"
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php-version }}"
coverage: "xdebug"
ini-values: "zend.assertions=1"
- name: "Install dependencies"
uses: "ramsey/composer-install@v2"
- name: "Run tests"
run: "./vendor/bin/phpunit --colors --testsuite=integration --do-not-cache-result --group=MySQL"
tests-unit:
name: "Unit Tests (PHP ${{ matrix.php-version }}, dependencies ${{ matrix.composer-dependencies }})"
runs-on: "ubuntu-22.04"
strategy:
matrix:
php-version:
- "8.2"
composer-dependencies:
- "lowest"
- "locked"
- "highest"
steps:
- name: "Checkout"
uses: "actions/checkout@v3"
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php-version }}"
coverage: "none"
ini-values: "zend.assertions=1"
- name: "Install dependencies"
uses: "ramsey/composer-install@v2"
with:
dependency-versions: "${{ matrix.composer-dependencies }}"
- name: "Run unit tests"
run: "./vendor/bin/phpunit --colors --testsuite=unit --do-not-cache-result"