-
Notifications
You must be signed in to change notification settings - Fork 50
128 lines (115 loc) · 3.93 KB
/
ci.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
name: CI
on:
push:
pull_request:
schedule:
- cron: '0 0 * * 0'
jobs:
tests:
name: Tests (PHP ${{ matrix.php }}, PostgreSQL ${{ matrix.postgres }}, PostGIS ${{ matrix.postgis }}, ORM ${{ matrix.orm || 'default' }}, DBAL ${{ matrix.dbal || 'default' }})
runs-on: ubuntu-latest
strategy:
matrix:
include:
# Lowest deps
- php: '8.0'
postgres: '11'
postgis: '3.0'
phpunit-flags: '--exclude-group=postgis-3.1'
composer-flags: '--prefer-stable --prefer-lowest'
# PostgresSQL / PostGIS matrix with ORM
- php: '8.1'
postgres: '11'
postgis: '3.0'
orm: '2.9'
phpunit-flags: '--exclude-group=postgis-3.1'
- php: '8.1'
postgres: '11'
postgis: '3.1'
orm: '2.9'
phpunit-flags: '--exclude-group=postgis-3.0'
- php: '8.1'
postgres: '12'
postgis: '3.0'
orm: '2.9'
phpunit-flags: '--exclude-group=postgis-3.1'
- php: '8.1'
postgres: '12'
postgis: '3.1'
orm: '2.9'
phpunit-flags: '--exclude-group=postgis-3.0'
- php: '8.1'
postgres: '13'
postgis: '3.0'
orm: '2.9'
phpunit-flags: '--exclude-group=postgis-3.1'
- php: '8.1'
postgres: '13'
postgis: '3.1'
orm: '2.9'
phpunit-flags: '--exclude-group=postgis-3.0'
code-coverage: 'yes'
# DBAL only
- php: '8.1'
postgres: '11'
postgis: '3.0'
dbal: '2.13'
phpunit-flags: '--exclude-group=postgis-3.1 --exclude-group=orm'
- php: '8.1'
postgres: '13'
postgis: '3.1'
dbal: '3.1'
phpunit-flags: '--exclude-group=postgis-3.0 --exclude-group=orm'
# Next PHP version
- php: '8.2'
postgres: '13'
postgis: '3.1'
phpunit-flags: '--exclude-group=postgis-3.0'
composer-flags: '--ignore-platform-reqs'
experimental: true
services:
postgis:
image: postgis/postgis:${{ matrix.postgres }}-${{ matrix.postgis }}-alpine
env:
POSTGRES_PASSWORD: 'postgres'
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: pdo_pgsql
coverage: pcov
- name: Install Doctrine ORM
if: matrix.orm != ''
run: composer require --no-interaction --no-update "doctrine/orm:^${{ matrix.orm }}"
- name: Install Doctrine DBAL
if: matrix.dbal != ''
run: |
composer remove --no-interaction --no-update --dev doctrine/orm
composer require --no-interaction --no-update "doctrine/dbal:^${{ matrix.dbal }}"
- name: Install dependencies
run: |
composer update --no-interaction --no-progress --prefer-dist ${{ matrix.composer-flags }}
composer info -D
- name: Run tests
if: matrix.code-coverage != 'yes'
run: vendor/bin/phpunit ${{ matrix.phpunit-flags }}
- name: Run tests with code coverage
if: matrix.code-coverage == 'yes'
run: vendor/bin/phpunit --coverage-clover build/logs/clover.xml ${{ matrix.phpunit-flags }}
- name: Upload coverage results to Coveralls
if: matrix.code-coverage == 'yes'
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
composer global require php-coveralls/php-coveralls
php-coveralls -v --coverage_clover=build/logs/clover.xml