-
Notifications
You must be signed in to change notification settings - Fork 301
120 lines (96 loc) · 3.77 KB
/
run-tests.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
name: Run Tests
on:
push:
pull_request:
schedule:
- cron: '0 8 * * *' # run at 08:00 UTC
jobs:
run-tests:
runs-on: ubuntu-latest
strategy:
matrix:
php: [8.0, 8.1, 8.2, 8.3, 8.4]
solr: [7, 8, 9]
mode: [cloud, server]
name: PHP ${{ matrix.php }}, Solr ${{ matrix.solr }} ${{ matrix.mode }}
env:
COMPOSER_MEMORY_LIMIT: -1
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, iconv, json, simplexml
ini-values: memory_limit=256M, post_max_size=256M, zend.exception_ignore_args=Off
coverage: pcov
- name: Checkout solarium
uses: actions/checkout@v4
- name: Checkout solr 7.7
if: matrix.solr == 7
uses: actions/checkout@v4
with:
repository: apache/lucene-solr
ref: branch_7_7
path: lucene-solr
- name: Checkout solr 8.11
if: matrix.solr == 8
uses: actions/checkout@v4
with:
repository: apache/lucene-solr
ref: branch_8_11
path: lucene-solr
- name: Checkout solr 9.7
if: matrix.solr == 9
uses: actions/checkout@v4
with:
repository: apache/solr
ref: branch_9_7
path: lucene-solr
- name: Start Solr ${{ matrix.solr }} in ${{ matrix.mode }} mode
run: |
chmod -R a+w lucene-solr
cd lucene-solr
patch -p1 < ../tests/Integration/Fixtures/solrconf.patch
patch -p1 < ../tests/Integration/Fixtures/schema${{ matrix.solr }}.patch
cd solr/server/solr/configsets/sample_techproducts_configs/conf
zip -r techproducts.zip *
cd -
mv solr/server/solr/configsets/sample_techproducts_configs/conf/techproducts.zip ../tests/Integration/Fixtures/
cd ../tests/Integration/Fixtures/docker/solr${{ matrix.solr }}_${{ matrix.mode }}
docker compose up -d
- name: Install dependencies
run: |
composer update
sed -i "s/'dev-.*'/'76.5.4'/g" vendor/composer/installed.php
- name: Run tests
run: |
vendor/bin/phpstan analyze src/ tests/ --level=1 --memory-limit=1G
vendor/bin/phpunit -c phpunit.xml --exclude-group skip_for_solr_${{ matrix.mode }} -v --coverage-clover build/logs/clover.xml
- name: Execute examples
run: |
cd examples
php execute_all.php
- uses: actions/upload-artifact@v4
with:
name: PHP_${{ matrix.php }}-Solr_${{ matrix.solr }}_${{ matrix.mode }}
path: build/logs
coverage:
runs-on: ubuntu-latest
name: Upload coverage to codecov.io
needs: [run-tests]
steps:
- name: Checkout solarium
uses: actions/checkout@v4
- name: Download coverage reports from tests
uses: actions/download-artifact@v4
- name: List report files
run: |
ls -l PHP*/clover*.xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: PHP*/clover*.xml
flags: unittests
name: solarium
fail_ci_if_error: false
verbose: false