Skip to content

Commit 1dcfb70

Browse files
committed
Added YAML tests in github action
1 parent 9b35e10 commit 1dcfb70

File tree

2 files changed

+51
-1
lines changed

2 files changed

+51
-1
lines changed

.github/workflows/yaml_test.yml

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: [8.1, 8.2, 8.3, 8.4]
13+
os: [ubuntu-latest]
14+
es-version: [9.0.0-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: YAML tests
48+
run: |
49+
source elastic-start-local/.env
50+
ELASTICSEARCH_URL="http://elastic:${ES_LOCAL_PASSWORD}@localhost:9200" TEST_SUITE="platinum" composer run-script integration-test

phpunit-yaml-serverless-tests.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
</php>
66
<testsuites>
77
<testsuite name="YAML serverless tests">
8-
<directory>tests/Yaml/Platinum</directory>
8+
<directory>tests/Yaml</directory>
99
</testsuite>
1010
</testsuites>
1111
<groups>

0 commit comments

Comments
 (0)