From 7092b05620ee9e2420df61d586fbef812b627a46 Mon Sep 17 00:00:00 2001 From: Kyler Berry Date: Fri, 11 Jun 2021 14:33:01 -0400 Subject: [PATCH 1/4] action.yml --- .github/workflows/php.yml | 44 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/php.yml diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml new file mode 100644 index 0000000..f6fc565 --- /dev/null +++ b/.github/workflows/php.yml @@ -0,0 +1,44 @@ +name: PHP Composer +php-version: '7.2' + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Validate composer.json and composer.lock + run: composer validate --strict + + - name: Setup ElasticSearch + # You may pin to the exact commit or the version. + # uses: getong/elasticsearch-action@95b501ab0c83dee0aac7c39b7cea3723bef14954 + uses: getong/elasticsearch-action@v1.2 + with: + # Version of elasticsearch to use + elasticsearch version: 6.8.0 + + - name: Cache Composer packages + id: composer-cache + uses: actions/cache@v2 + with: + path: vendor + key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-php- + + - name: Install dependencies + run: composer install --prefer-dist --no-progress + env: + COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Run test suite + run: ./vendor/bin/phpunit --coverage-text From 6142da16b16bbffff68cd270e1237a0533517fd0 Mon Sep 17 00:00:00 2001 From: Kyler Berry Date: Fri, 11 Jun 2021 14:36:16 -0400 Subject: [PATCH 2/4] remove yaml --- .travis.yml | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index c2746ad..0000000 --- a/.travis.yml +++ /dev/null @@ -1,29 +0,0 @@ -sudo: required -dist: trusty - -language: php -php: - - 5.5 - - 5.6 - - 7 - -env: - - DB=1.7.1 ES_PKG=https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-1.7.1.deb - - DB=2.2.0 ES_PKG=https://download.elasticsearch.org/elasticsearch/release/org/elasticsearch/distribution/deb/elasticsearch/2.2.0/elasticsearch-2.2.0.deb - - DB=5.3.2 ES_PKG=https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.3.2.deb - -before_install: - - curl -O $ES_PKG && sudo dpkg -i --force-confnew $(printf 'elasticsearch-%s.deb' $DB) - - sudo service elasticsearch start - - until curl localhost:9200; do sleep 1; done - -install: - # Make sure old ES versions use the old ES lib. ES lib 5.0+ is not compatible with old ES versions - - sh -c "if [ '$DB' = '1.7.1' ]; then sed -i 's/<6.0/<5.0/' composer.json; fi" - - sh -c "if [ '$DB' = '2.2.0' ]; then sed -i 's/<6.0/<5.0/' composer.json; fi" - - composer install - -script: ./vendor/bin/phpunit --coverage-text - -notifications: - email: false From 47428a3158907c769e023ef4056388e6f5eb00aa Mon Sep 17 00:00:00 2001 From: Kyler Berry Date: Mon, 14 Jun 2021 12:32:26 -0400 Subject: [PATCH 3/4] add github actions file for current php version --- .github/workflows/action.yml | 63 ++++++++++++++++++++++++++++++++++++ .github/workflows/php.yml | 44 ------------------------- composer.json | 4 +-- 3 files changed, 65 insertions(+), 46 deletions(-) create mode 100644 .github/workflows/action.yml delete mode 100644 .github/workflows/php.yml diff --git a/.github/workflows/action.yml b/.github/workflows/action.yml new file mode 100644 index 0000000..ccf45d3 --- /dev/null +++ b/.github/workflows/action.yml @@ -0,0 +1,63 @@ +name: PHP Test + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + test: + name: Php Build & Test + + strategy: + matrix: + php-version: [7] + os: [ubuntu-latest] + es-version: [5.3.2] + + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Use PHP ${{ matrix.php-version }} + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + extensions: curl + env: + COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Get composer cache directory + id: composercache + run: echo "::set-output name=dir::$(composer config cache-files-dir)" + + - name: Cache dependencies + uses: actions/cache@v2 + with: + path: ${{ steps.composercache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} + restore-keys: ${{ runner.os }}-composer- + + - name: Install dependencies + run: | + composer install --prefer-dist + + - name: Runs Elasticsearch ${{ matrix.es-version }} + uses: getong/elasticsearch-action@v1.2 + with: + elasticsearch version: '${{ matrix.es-version }}' + host port: 9200 + container port: 9200 + host node port: 9300 + node port: 9300 + discovery type: 'single-node' + + - name: Run test suite + run: ./vendor/bin/phpunit --coverage-text + env: + ELASTICSEARCH_URL: http://localhost:9200 \ No newline at end of file diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml deleted file mode 100644 index f6fc565..0000000 --- a/.github/workflows/php.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: PHP Composer -php-version: '7.2' - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - name: Validate composer.json and composer.lock - run: composer validate --strict - - - name: Setup ElasticSearch - # You may pin to the exact commit or the version. - # uses: getong/elasticsearch-action@95b501ab0c83dee0aac7c39b7cea3723bef14954 - uses: getong/elasticsearch-action@v1.2 - with: - # Version of elasticsearch to use - elasticsearch version: 6.8.0 - - - name: Cache Composer packages - id: composer-cache - uses: actions/cache@v2 - with: - path: vendor - key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} - restore-keys: | - ${{ runner.os }}-php- - - - name: Install dependencies - run: composer install --prefer-dist --no-progress - env: - COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Run test suite - run: ./vendor/bin/phpunit --coverage-text diff --git a/composer.json b/composer.json index 3cf52e8..97c6e16 100644 --- a/composer.json +++ b/composer.json @@ -10,8 +10,8 @@ ], "license": "MIT", "require": { - "php": ">=5.5.0", - "elasticsearch/elasticsearch": ">=1.0 <6.0", + "php": ">=7.0", + "elasticsearch/elasticsearch": "5.3.2", "psr/log": "^1.0" }, "autoload": { From 28cdad3b199b490ad0b3f290630dc578f8457718 Mon Sep 17 00:00:00 2001 From: Kyler Berry Date: Mon, 14 Jun 2021 14:28:09 -0400 Subject: [PATCH 4/4] allow any 50 es --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 97c6e16..c87c35b 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ "license": "MIT", "require": { "php": ">=7.0", - "elasticsearch/elasticsearch": "5.3.2", + "elasticsearch/elasticsearch": "^5.0", "psr/log": "^1.0" }, "autoload": {