Set logger using setLogger() method per PR comment #65
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: 'Continuous integration' | |
| on: ['push', 'pull_request'] | |
| jobs: | |
| cs: | |
| runs-on: 'ubuntu-20.04' | |
| name: 'Coding style' | |
| steps: | |
| - name: 'Checkout' | |
| uses: 'actions/checkout@v2' | |
| - name: 'Setup PHP' | |
| uses: 'shivammathur/setup-php@v2' | |
| with: | |
| php-version: '7.4' | |
| coverage: 'none' | |
| extensions: 'json, mbstring, tokenizer' | |
| tools: 'composer-normalize:2.28.0, php-cs-fixer:3.8.0' | |
| - name: 'Check PHP code' | |
| run: | | |
| php-cs-fixer fix --diff --dry-run --allow-risky=yes --using-cache=no | |
| - name: 'Check composer.json' | |
| run: | | |
| composer-normalize --diff --dry-run --indent-size=4 --indent-style=space --no-update-lock | |
| phpunit: | |
| runs-on: 'ubuntu-20.04' | |
| name: 'PHPUnit (PHP ${{ matrix.php }}, ES ${{ matrix.elasticsearch }})' | |
| timeout-minutes: 10 | |
| strategy: | |
| matrix: | |
| php: | |
| - '7.2' | |
| - '7.3' | |
| - '7.4' | |
| - '8.0' | |
| - '8.1' | |
| elasticsearch: | |
| - '7.15.2' | |
| fail-fast: false | |
| steps: | |
| - name: 'Checkout' | |
| uses: 'actions/checkout@v2' | |
| - name: 'Setup PHP' | |
| uses: 'shivammathur/setup-php@v2' | |
| with: | |
| php-version: '${{ matrix.php }}' | |
| coverage: 'pcov' | |
| tools: 'pecl, composer:v2' | |
| extensions: 'curl, json, mbstring, openssl' | |
| - name: 'Get composer cache directory' | |
| id: 'composer_cache' | |
| run: | | |
| echo "::set-output name=dir::$(composer config cache-files-dir)" | |
| - name: 'Cache dependencies' | |
| uses: 'actions/cache@v2' | |
| with: | |
| path: '${{ steps.composer_cache.outputs.dir }}' | |
| key: '${{ runner.os }}-composer-php${{ matrix.php }}-${{ hashFiles(''**/composer.json'') }}' | |
| restore-keys: | | |
| ${{ runner.os }}-composer-php${{ matrix.php }}- | |
| ${{ runner.os }}-composer- | |
| - name: 'Update dependencies' | |
| run: | | |
| composer update --prefer-dist --no-interaction --no-progress --ansi ${{ matrix.composer_flags }} | |
| - name: 'Run unit tests' | |
| run: | | |
| vendor/bin/phpunit --group unit --coverage-clover=build/coverage/unit-coverage.xml | |
| - name: 'Setup Elasticsearch' | |
| run: | | |
| sudo swapoff -a | |
| sudo sysctl -w vm.swappiness=1 | |
| sudo sysctl -w fs.file-max=262144 | |
| sudo sysctl -w vm.max_map_count=262144 | |
| ES_VERSION=${{ matrix.elasticsearch }} docker-compose --file=docker/docker-compose.proxy.yml --file=docker/docker-compose.es.yml up --detach | |
| docker run --rm --network=docker_elastic curlimages/curl --max-time 120 --retry-max-time 120 --retry 120 --retry-delay 5 --retry-all-errors --show-error --silent http://es01:9200 | |
| docker run --rm --network=docker_elastic curlimages/curl --max-time 120 --retry-max-time 120 --retry 120 --retry-delay 5 --retry-all-errors --show-error --silent http://es02:9200 | |
| - name: 'Run functional tests' | |
| run: | | |
| vendor/bin/phpunit --group functional --coverage-clover=build/coverage/functional-coverage.xml | |
| - name: 'Upload coverage to Codecov' | |
| uses: codecov/codecov-action@v2 | |
| with: | |
| files: build/coverage/unit-coverage.xml,build/coverage/functional-coverage.xml | |
| phpstan: | |
| runs-on: 'ubuntu-20.04' | |
| name: 'PHPStan (PHP ${{ matrix.php }}, ES ${{ matrix.elasticsearch }})' | |
| timeout-minutes: 10 | |
| strategy: | |
| matrix: | |
| php: | |
| - '8.1' | |
| elasticsearch: | |
| - '7.15.2' | |
| fail-fast: false | |
| steps: | |
| - name: 'Checkout' | |
| uses: 'actions/checkout@v2' | |
| - name: 'Setup PHP' | |
| uses: 'shivammathur/setup-php@v2' | |
| with: | |
| php-version: '${{ matrix.php }}' | |
| coverage: 'none' | |
| tools: 'pecl, composer:v2' | |
| extensions: 'curl, json, mbstring, openssl' | |
| - name: 'Get composer cache directory' | |
| id: 'composer_cache' | |
| run: | | |
| echo "::set-output name=dir::$(composer config cache-files-dir)" | |
| - name: 'Cache dependencies' | |
| uses: 'actions/cache@v2' | |
| with: | |
| path: '${{ steps.composer_cache.outputs.dir }}' | |
| key: '${{ runner.os }}-composer-php${{ matrix.php }}-${{ hashFiles(''**/composer.json'') }}' | |
| restore-keys: | | |
| ${{ runner.os }}-composer-php${{ matrix.php }}- | |
| ${{ runner.os }}-composer- | |
| - name: 'Update dependencies' | |
| run: | | |
| composer update --prefer-dist --no-interaction --no-progress --ansi ${{ matrix.composer_flags }} | |
| - name: 'Run phpstan' | |
| run: | | |
| vendor/bin/phpstan analyse --no-progress --error-format=github |