-
Notifications
You must be signed in to change notification settings - Fork 97
126 lines (107 loc) · 4.29 KB
/
pre-release-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
121
122
123
124
125
126
# Testing the code base against the Meilisearch pre-releases
name: Pre-Release Tests
# Will only run for PRs and pushes to bump-meilisearch-v*
on:
push:
branches: ['bump-meilisearch-v*']
pull_request:
branches: ['bump-meilisearch-v*']
jobs:
meilisearch-version:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Grep docker latest rc version of Meilisearch
id: grep-step
run: |
MEILISEARCH_VERSION=$(sh .github/scripts/get-latest-meilisearch-rc.sh)
echo $MEILISEARCH_VERSION
echo "version=$MEILISEARCH_VERSION" >> $GITHUB_OUTPUT
outputs:
version: ${{ steps.grep-step.outputs.version }}
tests:
runs-on: ubuntu-latest
needs: ['meilisearch-version']
name: integration-tests-against-rc (PHP ${{ matrix.php-versions }})
services:
meilisearch:
image: getmeili/meilisearch:${{ needs.meilisearch-version.outputs.version }}
ports:
- '7700:7700'
env:
MEILI_MASTER_KEY: masterKey
MEILI_NO_ANALYTICS: true
strategy:
matrix:
php-version: ['7.4', '8.0', '8.1', '8.2', '8.3']
http-client: ['Guzzle-7', 'Guzzle-7-Adapter', 'Symfony-HttpClient', 'PHP-HTTP-CurlClient', 'Kriswallsmith-Buzz']
exclude:
- php-version: '7.4'
http-client: 'Symfony-HttpClient'
- php-version: '8.0'
http-client: 'Symfony-HttpClient'
- php-version: '8.1'
http-client: 'Symfony-HttpClient'
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
coverage: none
- name: Validate composer.json and composer.lock
run: composer validate
- name: Switch to Guzzle7 Adapter
if: matrix.http-client == 'Guzzle-7-Adapter'
run: |
sed -i 's/"guzzlehttp\/guzzle": "^[0-9]\+\.[0-9]\+\.[0-9]\+\",/"php-http\/guzzle7-adapter": "^1.0.0",/' composer.json
- name: Switch to Symfony HttpClient
if: matrix.http-client == 'Symfony-HttpClient'
run: |
sed -i 's/"guzzlehttp\/guzzle": "^[0-9]\+\.[0-9]\+\.[0-9]\+\",/"symfony\/http-client": "^7.1.1",/' composer.json
sed -i 's/"http-interop\/http-factory-guzzle": "^[0-9]\+\.[0-9]\+\.[0-9]\+\",/"nyholm\/psr7": "^1.8.1",/' composer.json
- name: Switch to PHP HTTP CurlClient
if: matrix.http-client == 'PHP-HTTP-CurlClient'
run: |
sed -i 's/"guzzlehttp\/guzzle": "^[0-9]\+\.[0-9]\+\.[0-9]\+\",/"php-http\/curl-client": "^2.3.2",/' composer.json
sed -i 's/"http-interop\/http-factory-guzzle": "^[0-9]\+\.[0-9]\+\.[0-9]\+\",/"nyholm\/psr7": "^1.8.1",/' composer.json
- name: Switch to Kriswallsmith Buzz
if: matrix.http-client == 'Kriswallsmith-Buzz'
run: |
sed -i 's/"guzzlehttp\/guzzle": "^[0-9]\+\.[0-9]\+\.[0-9]\+\",/"kriswallsmith\/buzz": "^1.2.1",/' composer.json
sed -i 's/"http-interop\/http-factory-guzzle": "^[0-9]\+\.[0-9]\+\.[0-9]\+\",/"nyholm\/psr7": "^1.8.1",/' composer.json
- name: Install dependencies
uses: ramsey/composer-install@v3
- name: Run test suite
run: sh scripts/tests.sh
test_php_7_guzzle_6:
runs-on: ubuntu-latest
needs: ['meilisearch-version']
name: integration-tests-against-rc (PHP 7.4 & Guzzle 6)
services:
meilisearch:
image: getmeili/meilisearch:${{ needs.meilisearch-version.outputs.version }}
env:
MEILI_MASTER_KEY: 'masterKey'
MEILI_NO_ANALYTICS: 'true'
ports:
- '7700:7700'
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
coverage: none
- name: Validate composer.json and composer.lock
run: composer validate
- name: Switch to Guzzle 6
run: |
sed -i 's/"guzzlehttp\/guzzle": "^[0-9]\+\.[0-9]\+\.[0-9]\+\",/"php-http\/guzzle6-adapter": "^2.0.2",/' composer.json
- name: Install dependencies
uses: ramsey/composer-install@v3
- name: Run test suite - php-http/guzzle6-adapter
run: sh scripts/tests.sh