Skip to content

Commit

Permalink
Merge pull request #6 from zumba/kylerberry-patch-1
Browse files Browse the repository at this point in the history
Setup first github action
  • Loading branch information
kylerberry authored Jun 14, 2021
2 parents a9bb039 + 28cdad3 commit e47ff6b
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 31 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/action.yml
Original file line number Diff line number Diff line change
@@ -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
29 changes: 0 additions & 29 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
],
"license": "MIT",
"require": {
"php": ">=5.5.0",
"elasticsearch/elasticsearch": ">=1.0 <6.0",
"php": ">=7.0",
"elasticsearch/elasticsearch": "^5.0",
"psr/log": "^1.0"
},
"autoload": {
Expand Down

0 comments on commit e47ff6b

Please sign in to comment.