Skip to content

Commit 22588cd

Browse files
Add integration and yaml tests to 8.19 build
1 parent 4221564 commit 22588cd

4 files changed

Lines changed: 667 additions & 0 deletions

File tree

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: PHP integration tests
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
test:
7+
name: Test
8+
runs-on: ${{ matrix.os }}
9+
10+
strategy:
11+
matrix:
12+
php-version: [7.4, 8.0, 8.1, 8.2, 8.3, 8.4]
13+
os: [ubuntu-latest]
14+
es-version: [8.19.10-SNAPSHOT]
15+
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- name: Use PHP ${{ matrix.php-version }}
21+
uses: shivammathur/setup-php@v2
22+
with:
23+
php-version: ${{ matrix.php-version }}
24+
extensions: yaml, zip, curl
25+
coverage: none
26+
env:
27+
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
29+
- name: Get composer cache directory
30+
id: composercache
31+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
32+
- name: Cache dependencies
33+
uses: actions/cache@v4
34+
with:
35+
path: ${{ steps.composercache.outputs.dir }}
36+
key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ hashFiles('**/composer.json') }}
37+
restore-keys: ${{ runner.os }}-php-${{ matrix.php-version }}-
38+
39+
- name: Install dependencies
40+
run: |
41+
composer install --prefer-dist
42+
43+
- name: Run Elasticsearch using start-local
44+
run: |
45+
curl -fsSL https://elastic.co/start-local | sh -s -- -v ${{ matrix.es-version }} --esonly
46+
47+
- name: Integration tests
48+
run: |
49+
source elastic-start-local/.env
50+
ELASTICSEARCH_URL="http://elastic:${ES_LOCAL_PASSWORD}@localhost:9200" TEST_SUITE="free" composer run-script integration-test

.github/workflows/yaml_test.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: PHP YAML tests
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
test:
7+
name: Test
8+
runs-on: ${{ matrix.os }}
9+
10+
strategy:
11+
matrix:
12+
php-version: [7.4, 8.0, 8.1, 8.2, 8.3, 8.4]
13+
os: [ubuntu-latest]
14+
es-version: [8.19.10-SNAPSHOT]
15+
test-suite: [stack]
16+
branch-client-tests: ["8.19"]
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
22+
- name: Use PHP ${{ matrix.php-version }}
23+
uses: shivammathur/setup-php@v2
24+
with:
25+
php-version: ${{ matrix.php-version }}
26+
extensions: yaml, zip, curl
27+
coverage: none
28+
env:
29+
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
31+
- name: Get composer cache directory
32+
id: composercache
33+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
34+
- name: Cache dependencies
35+
uses: actions/cache@v4
36+
with:
37+
path: ${{ steps.composercache.outputs.dir }}
38+
key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ hashFiles('**/composer.json') }}
39+
restore-keys: ${{ runner.os }}-php-${{ matrix.php-version }}-
40+
41+
- name: Install dependencies
42+
run: |
43+
composer install --prefer-dist
44+
45+
- name: Run Elasticsearch using start-local
46+
run: |
47+
curl -fsSL https://elastic.co/start-local | sh -s -- -v ${{ matrix.es-version }} --esonly
48+
49+
- name: Build PHPUnit tests
50+
run: |
51+
git clone -b ${{ matrix.branch-client-tests }} https://github.com/elastic/elasticsearch-clients-tests.git tests/elasticsearch-clients-tests
52+
php tests/build_es_tests.php tests/elasticsearch-clients-tests/tests ${{ matrix.test-suite }} tests/Yaml
53+
54+
- name: YAML tests
55+
run: |
56+
source elastic-start-local/.env
57+
ELASTICSEARCH_URL="http://elastic:${ES_LOCAL_PASSWORD}@localhost:9200" TEST_SUITE="free" vendor/bin/phpunit -c "phpunit-yaml-${{ matrix.test-suite }}-tests.xml"

0 commit comments

Comments
 (0)