Skip to content

chore: remove safe, test against es 8 and os 2.11 #99

chore: remove safe, test against es 8 and os 2.11

chore: remove safe, test against es 8 and os 2.11 #99

Workflow file for this run

name: Tests
on:
push:
pull_request_target:
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
es_version:
- { image: 'docker.elastic.co/elasticsearch/elasticsearch:6.8.13', lib: '^6.0', proto: http, endpoint: 'http://localhost:9200/' }
- { image: 'docker.elastic.co/elasticsearch/elasticsearch:7.10.1', lib: '^7.0', proto: http, endpoint: 'http://localhost:9200/' }
- { image: 'docker.elastic.co/elasticsearch/elasticsearch:8.10.4', lib: '^7.0', proto: http, endpoint: 'https://elastic:admin@localhost:9200/' }
- { image: 'public.ecr.aws/opensearchproject/opensearch:1.2.4', lib: '^7.0', proto: https, endpoint: 'https://admin:admin@localhost:9200/' }
- { image: 'public.ecr.aws/opensearchproject/opensearch:2.11.0', lib: '^7.0', proto: https, endpoint: 'https://admin:admin@localhost:9200/' }
php_version:
- '7.4'
- '8.0'
- '8.1'
- '8.2'
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
--env ELASTIC_PASSWORD=admin
--env plugins.security.disabled=true
steps:
- uses: actions/checkout@v4
- 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 "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT"
- 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