-
Notifications
You must be signed in to change notification settings - Fork 0
160 lines (132 loc) · 4 KB
/
test-doctrine.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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
name: Doctrine
on:
workflow_run:
workflows: [CI]
types: [completed]
workflow_dispatch:
inputs:
run_id:
description: Workflow run id
required: true
type: number
permissions:
contents: read
actions: read
checks: write
jobs:
test:
name: Doctrine tests
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
doctrine-branch:
- 2.19.x
- 3.2.x
php-branch:
- master
- PHP-8.4
- PHP-8.3
- PHP-8.2
db-type:
- sqlite
- pgsql
- mysql
exclude:
- db-type: mysql # Errors re: collation
doctrine-branch: 3.2.x
- php-branch: master # Not ready yet
doctrine-branch: 2.19.x
env:
PHP_DIR: /opt/${{ matrix.php-branch }}
PHP: /opt/${{ matrix.php-branch }}/bin/php
services:
postgres:
image: ${{ ( matrix.db-type == 'pgsql' ) && 'postgres:latest' || '' }}
env:
POSTGRES_PASSWORD: secret
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
mysql:
image: ${{ ( matrix.db-type == 'mysql' ) && 'mysql:latest' || '' }}
env:
MYSQL_USER: user
MYSQL_PASSWORD: secret
MYSQL_DATABASE: doctrine_tests_tmp
MYSQL_ROOT_PASSWORD: secret
options: >-
--health-cmd "mysqladmin ping"
--health-interval 5s
--health-timeout 2s
--health-retries 5
ports:
- 3306:3306
steps:
- name: Setup
run: |
sudo apt-get update -qq
sudo apt-get install -y -qq sqlite3 libicu74
- name: Install PHP from artifact
uses: dawidd6/action-download-artifact@v3
with:
name: ${{ matrix.php-branch }}
path: /opt/${{ matrix.php-branch }}
workflow: ${{ github.event.workflow.id || 'CI' }}
run_id: ${{ github.event.workflow_run.id || inputs.run_id }}
- name: Checkout
uses: actions/checkout@v4
with:
repository: doctrine/orm
ref: ${{ matrix.doctrine-branch }}
- name: Checkout build configuration
uses: actions/checkout@v4
with:
path: build
- name: Enable PHP and install Composer
run: build/php-composer.sh
- name: Copy build configuration
if: matrix.db-type != 'sqlite'
run: cp build/doctrine/phpunit-${{ matrix.db-type }}-${{ matrix.doctrine-branch }}.xml phpunit.xml
- name: Install dependencies with Composer
run: composer install
- name: Run tests
run: $PHP -d memory_limit=1G vendor/bin/phpunit --log-junit junit-${{ matrix.doctrine-branch }}-${{ matrix.php-branch }}-${{ matrix.db-type }}.xml
- name: Upload test report
uses: actions/upload-artifact@v4
if: always() # always run even if the previous step fails
with:
name: test-results-${{ matrix.doctrine-branch }}-${{ matrix.php-branch }}-${{ matrix.db-type }}
path: 'junit-*.xml'
retention-days: 1
report:
name: Collect results
runs-on: ubuntu-24.04
needs:
- test
if: always()
steps:
- name: Checkout
uses: actions/checkout@v4
with:
repository: doctrine/orm
- name: Download Test Report
uses: dawidd6/action-download-artifact@v3
with:
run_id: ${{ github.run_id }}
name: test-results-.*
name_is_regexp: true
if_no_artifact_found: warn
path: test-results
- name: Publish Test Report
uses: mbeccati/test-reporter@phpunit-support
with:
name: Doctrine Test results
path: '**/junit-*.xml'
reporter: java-junit
only-summary: true