Skip to content

Commit

Permalink
Fix minor corrections.
Browse files Browse the repository at this point in the history
  • Loading branch information
terabytesoftw committed Sep 29, 2023
1 parent 031ed8c commit d6d9a35
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 38 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.yml]
indent_size = 2
66 changes: 39 additions & 27 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
on:
pull_request:
paths-ignore:
- 'docs/**'
- 'README.md'
- 'CHANGELOG.md'
- '.gitignore'
- '.gitattributes'
- 'infection.json.dist'
- 'psalm.xml'

push:
paths-ignore:
- 'docs/**'
- 'README.md'
- 'CHANGELOG.md'
- '.gitignore'
- '.gitattributes'
- 'infection.json.dist'
- 'psalm.xml'
pull_request:
paths-ignore:
- 'docs/**'
- 'README.md'
- 'CHANGELOG.md'
- '.gitignore'
- '.gitattributes'
- 'infection.json.dist'
- 'psalm.xml'

push:
paths-ignore:
- 'docs/**'
- 'README.md'
- 'CHANGELOG.md'
- '.gitignore'
- '.gitattributes'
- 'infection.json.dist'
- 'psalm.xml'

name: build

jobs:
tests:
name: PHP ${{ matrix.php-version }} / ES ${{ matrix.es-version }}
name: PHP ${{ matrix.php }} / ES ${{ matrix.es }}

env:
extensions: curl, mbstring, dom, intl
key: cache-v1

runs-on: ubuntu-latest

strategy:
matrix:
php-version:
php:
- 7.3
- 7.4
- 8.0
- 8.1
- 8.2
- 8.3

es-version:
es:
- 8.1.3
- 7.14.0
- 7.7.0
Expand All @@ -49,13 +49,13 @@ jobs:

steps:
- name: Service elastisearch 8.1.3.
if: matrix.es-version == '8.1.3'
if: matrix.es == '8.1.3'
run: |
docker network create somenetwork
docker run -d --name elasticsearch --net somenetwork -p 9200:9200 -e "http.publish_host=127.0.0.1" -e "transport.host=127.0.0.1" -e "indices.id_field_data.enabled=true" -e "xpack.security.enabled=false" elasticsearch:${{ matrix.es-version }}
- name: Service elastisearch < 8.1.3.
if: matrix.es-version != '8.1.3'
if: matrix.es != '8.1.3'
run: |
docker network create somenetwork
docker run -d --name elasticsearch --net somenetwork -p 9200:9200 -e "http.publish_host=127.0.0.1" -e "transport.host=127.0.0.1" elasticsearch:${{ matrix.es-version }}
Expand All @@ -66,7 +66,7 @@ jobs:
- name: Install PHP with extensions.
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
php-version: ${{ matrix.php }}
extensions: ${{ env.extensions }}
ini-values: date.timezone='UTC'

Expand All @@ -77,4 +77,16 @@ jobs:
run: wget --retry-connrefused --waitretry=3 --timeout=30 -t 10 -O /dev/null http://127.0.0.1:9200

- name: Run tests with phpunit.
run: ES_VERSION=${{ matrix.es-version }} vendor/bin/phpunit
if: matrix.php != '8.1'
run: ES_VERSION=${{ matrix.es }} vendor/bin/phpunit --colors=always

- name: Run tests with phpunit and generate coverage.
if: matrix.php == '8.1'
run: ES_VERSION=${{ matrix.es }} vendor/bin/phpunit --coverage-clover=coverage.xml --colors=always

- name: Upload coverage to Codecov.
if: matrix.php == '8.1'
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
37 changes: 26 additions & 11 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,13 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<phpunit bootstrap="./tests/bootstrap.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
stopOnFailure="false">
<testsuites>
<testsuite name="Test Suite">
<directory>./tests</directory>
</testsuite>
</testsuites>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
bootstrap="./tests/bootstrap.php"
colors="true" convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
stopOnFailure="false"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
>

<php>
<ini name="error_reporting" value="-1"/>
</php>

<testsuites>
<testsuite name="Yii2-ElasticSearch">
<directory>./tests</directory>
</testsuite>
</testsuites>

<coverage>
<include>
<directory>./src</directory>
</include>
</coverage>
</phpunit>

0 comments on commit d6d9a35

Please sign in to comment.