-
Notifications
You must be signed in to change notification settings - Fork 28
144 lines (121 loc) · 4.24 KB
/
continuous-integration.yml
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
name: "Continuous Integration"
on: [push, pull_request]
jobs:
phpunit-sqlite:
# The SQLite version depends on the current environment. See documentation:
# https://github.com/actions/virtual-environments/tree/main/images/linux
name: "PHPUnit with SQLite, PHP: ${{ matrix.php-version }}"
runs-on: ubuntu-latest
# If true, allow this job to fail:
continue-on-error: true
strategy:
matrix:
# Define jobs for all combinations of values given to be tested:
php-version: ["5.6"]
steps:
- name: "Checkout"
uses: "actions/checkout@v4"
with:
fetch-depth: 2
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php-version }}"
coverage: "xdebug"
- name: Validate composer.json and composer.lock
run: composer validate
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: composer install --no-progress
- name: Set up unit testing
run: .github/actions/setup.sh
env:
DB: sqlite
- name: Run unit tests
run: .github/actions/run_tests.sh
- name: "Upload to Codecov"
uses: "codecov/codecov-action@v3"
phpunit-mariadb:
name: "PHPUnit with MariaDB: ${{ matrix.mariadb-version }}, PHP: ${{ matrix.php-version }}, extension: ${{ matrix.extension }}"
runs-on: ubuntu-latest
# If true, allow the job to fail:
continue-on-error: ${{ matrix.experimental }}
strategy:
# If true, stop jobs if a required job fails:
fail-fast: false
matrix:
# Define jobs for all combinations of php, mariadb and extension, up to "include"
# Tests will be performed for each combination
# These can fail if "experimental" is true. Currently all must pass
php-version: ["5.4", "5.5", "5.6", "7.0", "7.1"]
mariadb-version: ["10.3"]
extension: ["pdo_mysql"]
experimental: [false]
include:
# Define jobs for individual combinations to be tested
# These can fail if "experimental" is true. Currently all can fail
- php-version: "7.2"
mariadb-version: "10.3"
extension: "pdo_mysql"
experimental: true
- php-version: "7.3"
mariadb-version: "10.3"
extension: "pdo_mysql"
experimental: true
- php-version: "7.4"
mariadb-version: "10.3"
extension: "pdo_mysql"
experimental: true
- php-version: "8.0"
mariadb-version: "10.3"
extension: "pdo_mysql"
experimental: true
services:
mariadb:
image: "mariadb:${{ matrix.mariadb-version }}"
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: "doctrine"
MYSQL_USER: "user"
MYSQL_PASSWORD: "password"
options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
ports:
- "3306:3306"
steps:
- name: "Checkout"
uses: "actions/checkout@v4"
with:
fetch-depth: 2
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php-version }}"
coverage: "xdebug"
extensions: "${{ matrix.extension }}"
- name: Validate composer.json and composer.lock
run: composer validate
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: composer install --no-progress
- name: Set up unit testing
run: .github/actions/setup.sh
env:
DB: mysql
- name: Run unit tests
run: .github/actions/run_tests.sh
- name: "Upload to Codecov"
uses: "codecov/codecov-action@v3"