Skip to content

Commit

Permalink
Merge 02b0c4f into 14ecd1a
Browse files Browse the repository at this point in the history
  • Loading branch information
mikey179 authored Feb 17, 2020
2 parents 14ecd1a + 02b0c4f commit 6fc6b51
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 1 deletion.
64 changes: 64 additions & 0 deletions .github/workflows/runTests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Tests

on: [push]

jobs:
build:

runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
php-versions: ['7.3', '7.4']
os: [ubuntu-latest, windows-latest, macOS-latest]

steps:
- name: Configure git
if: runner.os == 'Windows'
run: git config --system core.autocrlf false; git config --system core.eol lf

- name: Checkout
uses: actions/checkout@v2

- name: Set up PHP ${{ matrix.php-versions }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring
coverage: xdebug
tools: cs2pr, phpstan

- name: Setup Problem Matchers for PHP
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"

- name: Setup Problem Matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

- name: Validate composer.json and composer.lock
run: composer validate

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v1
with:
path: vendor
key: ${{ runner.os }}-node-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer install --prefer-dist --no-progress --no-suggest

- name: Run test suite
run: composer run-script test -- --coverage-text

- name: Notify Coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: |
composer require php-coveralls/php-coveralls
composer run-script php-coveralls -- --verbose
- name: PHPStan
run: phpstan analyse --error-format=checkstyle | cs2pr
6 changes: 5 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,9 @@
}
},
"minimum-stability": "dev",
"prefer-stable": true
"prefer-stable": true,
"scripts": {
"test": "phpunit",
"php-coveralls": "php-coveralls"
}
}

0 comments on commit 6fc6b51

Please sign in to comment.