@@ -4,83 +4,123 @@ 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
+ ports :
35
+ - ' 7700:7700'
36
+ env :
37
+ MEILI_MASTER_KEY : masterKey
38
+ MEILI_NO_ANALYTICS : true
14
39
strategy :
15
40
matrix :
16
- php-versions : ['7.4', '8.0', '8.1', '8.2', '8.3']
17
- name : integration-tests-against-rc (PHP ${{ matrix.php-versions }})
41
+ php-version : ['7.4', '8.0', '8.1', '8.2', '8.3']
42
+ http-client : ['Guzzle-7', 'Guzzle-7-Adapter', 'Symfony-HttpClient', 'PHP-HTTP-CurlClient', 'Kriswallsmith-Buzz']
43
+ exclude :
44
+ - php-version : ' 7.4'
45
+ http-client : ' Symfony-HttpClient'
46
+ - php-version : ' 8.0'
47
+ http-client : ' Symfony-HttpClient'
48
+ - php-version : ' 8.1'
49
+ http-client : ' Symfony-HttpClient'
18
50
steps :
19
- - uses : actions/checkout@v4
51
+ - name : Checkout code
52
+ uses : actions/checkout@v4
53
+
20
54
- name : Install PHP
21
55
uses : shivammathur/setup-php@v2
22
56
with :
23
57
php-version : ${{ matrix.php-versions }}
24
58
coverage : none
59
+
25
60
- name : Validate composer.json and composer.lock
26
61
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://raw.githubusercontent.com/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
62
+
63
+ - name : Switch to Guzzle7 Adapter
64
+ if : matrix.http-client == 'Guzzle-7-Adapter'
40
65
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
66
+ sed -i 's/"guzzlehttp\/guzzle": "^[0-9]\+\.[0-9]\+\.[0-9]\+\",/" php-http\ /guzzle7-adapter": "^1.0.0",/' composer.json
67
+
68
+ - name : Switch to Symfony HttpClient
69
+ if : matrix. http-client == 'Symfony-HttpClient'
45
70
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
71
+ sed -i 's/"guzzlehttp\/guzzle": "^[0-9]\+\.[0-9]\+\.[0-9]\+\",/"symfony\/http-client": "^7.1.1",/' composer.json
72
+ sed -i 's/"http-interop\/http-factory-guzzle": "^[0-9]\+\.[0-9]\+\.[0-9]\+\",/"nyholm\/psr7": "^1.8.1",/' composer.json
73
+
74
+ - name : Switch to PHP HTTP CurlClient
75
+ if : matrix.http-client == 'PHP-HTTP-CurlClient'
50
76
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
77
+ sed -i 's/"guzzlehttp\/guzzle": "^[0-9]\+\.[0-9]\+\.[0-9]\+\",/"php-http\/curl-client": "^2.3.2",/' composer.json
78
+ sed -i 's/"http-interop\/http-factory-guzzle": "^[0-9]\+\.[0-9]\+\.[0-9]\+\",/"nyholm\/psr7": "^1.8.1",/' composer.json
79
+
80
+ - name : Switch to Kriswallsmith Buzz
81
+ if : matrix.http-client == 'Kriswallsmith-Buzz'
55
82
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
83
+ sed -i 's/"guzzlehttp\/guzzle": "^[0-9]\+\.[0-9]\+\.[0-9]\+\",/"kriswallsmith\/buzz": "^1.2.1",/' composer.json
84
+ sed -i 's/"http-interop\/http-factory-guzzle": "^[0-9]\+\.[0-9]\+\.[0-9]\+\",/"nyholm\/psr7": "^1.8.1",/' composer.json
85
+
86
+ - name : Install dependencies
87
+ uses : ramsey/composer-install@v3
88
+
89
+ - name : Run test suite
90
+ run : sh scripts/tests.sh
60
91
61
92
test_php_7_guzzle_6 :
62
93
runs-on : ubuntu-latest
94
+ needs : ['meilisearch-version']
63
95
name : integration-tests-against-rc (PHP 7.4 & Guzzle 6)
96
+ services :
97
+ meilisearch :
98
+ image : getmeili/meilisearch:${{ needs.meilisearch-version.outputs.version }}
99
+ env :
100
+ MEILI_MASTER_KEY : ' masterKey'
101
+ MEILI_NO_ANALYTICS : ' true'
102
+ ports :
103
+ - ' 7700:7700'
104
+
64
105
steps :
65
- - uses : actions/checkout@v4
106
+ - name : Checkout code
107
+ uses : actions/checkout@v4
108
+
66
109
- name : Install PHP
67
110
uses : shivammathur/setup-php@v2
68
111
with :
69
112
php-version : ' 7.4'
70
113
coverage : none
114
+
71
115
- name : Validate composer.json and composer.lock
72
116
run : composer validate
73
- - name : Install dependencies
117
+
118
+ - name : Switch to Guzzle 6
74
119
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://raw.githubusercontent.com/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
120
+ sed -i 's/"guzzlehttp\/guzzle": "^[0-9]\+\.[0-9]\+\.[0-9]\+\",/"php-http\/guzzle6-adapter": "^2.0.2",/' composer.json
121
+
122
+ - name : Install dependencies
123
+ uses : ramsey/composer-install@v3
124
+
83
125
- 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
126
+ run : sh scripts/tests.sh
0 commit comments