Skip to content

chore: allow thecodingmachine/safe 2.0 #92

chore: allow thecodingmachine/safe 2.0

chore: allow thecodingmachine/safe 2.0 #92

Workflow file for this run

name: Tests
on:
push:
pull_request_target:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
es_version:
- { image: 'elasticsearch:6.8.13', lib: '^6.0', proto: http, endpoint: 'http://localhost:9200/' }
- { image: 'elasticsearch:7.10.1', lib: '^7.0', proto: http, endpoint: 'http://localhost:9200/' }
- { image: 'opensearchproject/opensearch:1.2.4', lib: '^7.0', proto: https, endpoint: 'https://admin:admin@localhost:9200/' }
php_version:
- '7.4'
- '8.0'
# Currently disabled as proxy-manager for php8.1 is not released yet.
# - '8.1'
name: PHP ${{ matrix.php_version }} against ${{ matrix.es_version.image }}
services:
elasticsearch:
image: ${{ matrix.es_version.image }}
ports:
- '9200:9200'
options: >-
--env discovery.type=single-node
steps:
- uses: actions/checkout@v2
- name: Setup PHP with pecl extension
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php_version }}
extensions: :opcache
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache dependencies installed with composer
uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: php-${{ matrix.php_version }}-composer-locked-${{ hashFiles('composer.lock') }}
restore-keys: php-${{ matrix.php_version }}-composer-locked-
- name: Adding correct version of elastica to composer.json
run: composer require --no-update ruflin/elastica ${{ matrix.es_version.lib }}
- run: composer install
- name: Waiting for ES server to become available
run: ./wait-for-it.sh -p ${{ matrix.es_version.proto }} localhost:9200
- run: vendor/bin/phpunit --coverage-clover coverage.xml
env:
ES_ENDPOINT: ${{ matrix.es_version.endpoint }}
XDEBUG_MODE: coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
file: ./coverage.xml