-
-
Notifications
You must be signed in to change notification settings - Fork 252
80 lines (67 loc) · 2.26 KB
/
build.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
on:
pull_request:
paths-ignore:
- 'docs/**'
- 'README.md'
- 'CHANGELOG.md'
- '.gitignore'
- '.gitattributes'
- 'infection.json.dist'
- 'psalm.xml'
push:
paths-ignore:
- 'docs/**'
- 'README.md'
- 'CHANGELOG.md'
- '.gitignore'
- '.gitattributes'
- 'infection.json.dist'
- 'psalm.xml'
name: build
jobs:
tests:
name: PHP ${{ matrix.php-version }} / ES ${{ matrix.es-version }}
env:
extensions: curl, mbstring, dom, intl
key: cache-v1
runs-on: ubuntu-latest
strategy:
matrix:
php-version:
- 7.3
- 7.4
- 8.0
- 8.1
- 8.2
- 8.3
es-version:
- 8.1.3
- 7.14.0
- 7.7.0
- 6.8.9
- 5.6.16
steps:
- name: Service elastisearch 8.1.3.
if: matrix.es-version == '8.1.3'
run: |
docker network create somenetwork
docker run -d --name elasticsearch --net somenetwork -p 9200:9200 -e "http.publish_host=127.0.0.1" -e "transport.host=127.0.0.1" -e "indices.id_field_data.enabled=true" -e "xpack.security.enabled=false" elasticsearch:${{ matrix.es-version }}
- name: Service elastisearch < 8.1.3.
if: matrix.es-version != '8.1.3'
run: |
docker network create somenetwork
docker run -d --name elasticsearch --net somenetwork -p 9200:9200 -e "http.publish_host=127.0.0.1" -e "transport.host=127.0.0.1" elasticsearch:${{ matrix.es-version }}
- name: Checkout.
uses: actions/checkout@v3
- name: Install PHP with extensions.
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: ${{ env.extensions }}
ini-values: date.timezone='UTC'
- name: Install dependencies with composer.
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader
- name: Wait for Elasticsearch server to start.
run: wget --retry-connrefused --waitretry=3 --timeout=30 -t 10 -O /dev/null http://127.0.0.1:9200
- name: Run tests with phpunit.
run: ES_VERSION=${{ matrix.es-version }} vendor/bin/phpunit