-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
217 lines (166 loc) · 5.82 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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
name: "Continuous Integration"
on:
- push
- pull_request
permissions:
contents: read
env:
COMPOSER_ROOT_VERSION: dev-main
jobs:
tests:
name: "CI (PHP ${{ matrix.php-version }}, ${{ matrix.dependencies }} deps)"
runs-on: "${{ matrix.operating-system }}"
strategy:
fail-fast: false
matrix:
php-version:
- "8.1"
- "8.2"
- "8.3"
- "8.4"
dependencies: [highest]
composer-options: [""]
operating-system:
- "ubuntu-latest"
include:
- php-version: "8.1"
dependencies: lowest
operating-system: ubuntu-latest
- php-version: "8.4"
dependencies: highest
operating-system: ubuntu-latest
composer-options: "--ignore-platform-req=php+"
steps:
- uses: "actions/checkout@v4"
- name: Run CouchDB
timeout-minutes: 3
continue-on-error: true
uses: "cobot/couchdb-action@master"
with:
couchdb version: '2.3.1'
- name: Run MongoDB
uses: supercharge/mongodb-github-action@1.11.0
with:
mongodb-version: 5.0
- uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
extensions: mongodb, redis, amqp
tools: "composer:v2"
ini-values: "memory_limit=-1"
- name: Add require for mongodb/mongodb to make tests runnable
run: 'composer require mongodb/mongodb --dev --no-update'
- name: "Change dependencies"
run: |
composer require --no-update --no-interaction --dev elasticsearch/elasticsearch:^7
- uses: "ramsey/composer-install@v3"
with:
dependency-versions: "${{ matrix.dependencies }}"
composer-options: "${{ matrix.composer-options }}"
- name: "Run tests"
if: "matrix.php-version >= '8.2'"
run: "composer exec phpunit -- --exclude-group Elasticsearch --exclude-group Elastica"
- name: "Run tests"
if: "matrix.php-version == '8.1'"
run: "composer exec phpunit -- --exclude-group Elasticsearch,Elastica"
tests-es-7:
name: "CI with ES ${{ matrix.es-version }} on PHP ${{ matrix.php-version }}"
needs: "tests"
runs-on: "${{ matrix.operating-system }}"
strategy:
fail-fast: false
matrix:
operating-system:
- "ubuntu-latest"
php-version:
- "8.1"
dependencies:
- "highest"
- "lowest"
es-version:
- "7.0.0"
- "7.17.0"
steps:
- uses: "actions/checkout@v4"
# required for elasticsearch
- name: Configure sysctl limits
run: |
sudo swapoff -a
sudo sysctl -w vm.swappiness=1
sudo sysctl -w fs.file-max=262144
sudo sysctl -w vm.max_map_count=262144
- name: Run Elasticsearch
timeout-minutes: 3
uses: elastic/elastic-github-actions/elasticsearch@master
with:
stack-version: "${{ matrix.es-version }}"
- uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
extensions: mongodb, redis, amqp
tools: "composer:v2"
ini-values: "memory_limit=-1"
- name: "Change dependencies"
run: "composer require --no-update --no-interaction --dev elasticsearch/elasticsearch:^${{ matrix.es-version }}"
- uses: "ramsey/composer-install@v3"
with:
dependency-versions: "${{ matrix.dependencies }}"
- name: "Run tests"
run: "composer exec phpunit -- --group Elasticsearch,Elastica"
- name: "Run tests with psr/log 3"
if: "contains(matrix.dependencies, 'highest') && matrix.php-version >= '8.0'"
run: |
composer remove --no-update --dev graylog2/gelf-php ruflin/elastica elasticsearch/elasticsearch rollbar/rollbar
composer require --no-update --no-interaction --dev ruflin/elastica:^7 elasticsearch/elasticsearch:^7
composer require --no-update psr/log:^3
composer update
composer exec phpunit -- --group Elasticsearch,Elastica
tests-es-8:
name: "CI with ES ${{ matrix.es-version }} on PHP ${{ matrix.php-version }}"
needs: "tests"
runs-on: "${{ matrix.operating-system }}"
strategy:
fail-fast: false
matrix:
operating-system:
- "ubuntu-latest"
php-version:
- "8.1"
dependencies:
- "highest"
- "lowest"
es-version:
- "8.0.0"
- "8.2.0"
steps:
- uses: "actions/checkout@v4"
# required for elasticsearch
- name: Configure sysctl limits
run: |
sudo swapoff -a
sudo sysctl -w vm.swappiness=1
sudo sysctl -w fs.file-max=262144
sudo sysctl -w vm.max_map_count=262144
- name: Run Elasticsearch
timeout-minutes: 3
uses: elastic/elastic-github-actions/elasticsearch@master
with:
stack-version: "${{ matrix.es-version }}"
- uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
extensions: mongodb, redis, amqp
tools: "composer:v2"
ini-values: "memory_limit=-1"
- name: "Change dependencies"
run: |
composer remove --no-update --dev graylog2/gelf-php ruflin/elastica elasticsearch/elasticsearch rollbar/rollbar
composer require --no-update --no-interaction --dev elasticsearch/elasticsearch:^8 ruflin/elastica:^8
- uses: "ramsey/composer-install@v3"
with:
dependency-versions: "${{ matrix.dependencies }}"
- name: "Run tests"
run: "composer exec phpunit -- --group Elasticsearch,Elastica"