-
Notifications
You must be signed in to change notification settings - Fork 21
107 lines (105 loc) · 3.77 KB
/
full.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: Doctrine spatial test
on:
push:
pull_request:
branches: [ dev, main ]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.orm == '^3.2' || matrix.orm == '^4.0'}}
environment: 'Test environment'
strategy:
fail-fast: false
matrix:
php: [ '8.1', '8.2', '8.3' ]
orm: [ '^2.9', '^3.1', '^3.2', '^4.0' ]
name: PHP${{ matrix.php }} - doctrine/orm ${{ matrix.orm }}
env:
HAS_CC_SECRET: ${{secrets.CC_TEST_REPORTER_ID != '' }}
HAS_CA_SECRET: ${{secrets.COVERALLS_REPO_TOKEN != '' }}
services:
mysql5:
image: mysql:5.7
env:
MYSQL_DATABASE: main
MYSQL_USER: main
MYSQL_PASSWORD: main
MYSQL_ROOT_PASSWORD: main
ports:
- 3357:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
mysql8:
image: mysql:8.0
env:
MYSQL_DATABASE: main
MYSQL_USER: main
MYSQL_PASSWORD: main
MYSQL_ROOT_PASSWORD: main
ports:
- 3380:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
postgres:
# Docker Hub image
image: postgis/postgis
# Provide the password for postgres
env:
POSTGRES_PASSWORD: main
POSTGRES_USER: main
POSTGRES_DATABASE: main
ports:
- 5432:5432
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- name: Validate composer.json
run: composer validate --strict
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Setup PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: pcov
tools: composer:v2
- name: Echo PHP version
run: php -v
- name: Copy testsuites
run: cp .github/phpunit.*.xml .
- name: Install libraries
run: composer --prefer-stable update -vvv
- name: Force doctrine/orm library to ${{ matrix.orm }}
run: composer --prefer-stable require doctrine/orm:${{ matrix.orm }} --with-all-dependencies
- name: Run test suite and coverage
if: ${{ matrix.php == '8.3' && matrix.orm == '^3.1' && env.HAS_CC_SECRET == 'true' }}
uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}
with:
coverageCommand: composer run-script test-coverage
coverageLocations: ${{github.workspace}}/.phpunit.cache/code-coverage/clover*.xml:clover
- name: Run test suite for forks or version without coverage
if: ${{ matrix.php != '8.3' || matrix.orm != '^3.1' || env.HAS_CC_SECRET != 'true' }}
run: composer run-script test
- name: Coveralls.io steps
if: ${{ matrix.php == '8.3' && matrix.orm == '^3.1' && env.HAS_CA_SECRET == 'true' }}
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.COVERALLS_REPO_TOKEN }}
file: ${{github.workspace}}/.phpunit.cache/code-coverage/clover.xml
- name: Check quality code
run: composer run-script check-quality-code