Skip to content

Commit

Permalink
Merge b22dcb7 into e24aecb
Browse files Browse the repository at this point in the history
  • Loading branch information
xificurk committed Nov 1, 2020
2 parents e24aecb + b22dcb7 commit 8e9a4c7
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 42 deletions.
91 changes: 91 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: CI

on:
push:
pull_request:
schedule:
- cron: '0 10 * * 5'

jobs:
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php:
- 7.4
composer_args:
- ''
- '--prefer-stable'
- '--prefer-stable --prefer-lowest'
name: PHP ${{ matrix.php }} ${{ matrix.composer_args }}
steps:
- uses: actions/checkout@v2
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none
- name: Cache
uses: actions/cache@v2
with:
path: ~/.cache/composer
key: composer-${{ hashFiles('composer.json') }}-${{ matrix.php }}-${{ matrix.composer_args }}-${{ github.run_number }}
restore-keys: |
composer-${{ hashFiles('composer.json') }}-${{ matrix.php }}-${{ matrix.composer_args }}
composer-${{ hashFiles('composer.json') }}-${{ matrix.php }}
composer-${{ hashFiles('composer.json') }}
composer-
- name: Build
env:
COMPOSER_ARGS: ${{ matrix.composer_args }}
run: composer update --no-interaction --no-progress --prefer-dist $COMPOSER_ARGS
- name: Lint
run: vendor/bin/parallel-lint -e php,phpt --exclude tests/temp src tests
- name: Tests
run: vendor/bin/tester -c tests/php.ini -s tests
- name: PHPStan
run: |
vendor/bin/phpstan analyse
vendor/bin/phpstan analyse -c phpstan.tests.neon.dist
- if: failure()
uses: actions/upload-artifact@v2
with:
name: output
path: tests/**/output

code_style:
runs-on: ubuntu-latest
needs: [ tests ]
name: Code Style
steps:
- uses: actions/checkout@v2
- uses: shivammathur/setup-php@v2
with:
php-version: 7.4
coverage: none
- name: Build
run: composer update --no-interaction --no-progress --prefer-dist --prefer-stable
- name: Check Code Style
run: vendor/bin/phpcs

code_coverage:
runs-on: ubuntu-latest
needs: [ tests ]
continue-on-error: true
name: Code Coverage
steps:
- uses: actions/checkout@v2
- uses: shivammathur/setup-php@v2
with:
php-version: 7.4
coverage: none
- run: composer global require php-coveralls/php-coveralls
- name: Build
run: composer update --no-interaction --no-progress --prefer-dist --prefer-stable
- name: Calculate coverage
run: vendor/bin/tester -c tests/php.ini -p phpdbg tests --coverage coverage.xml --coverage-src src
- name: Upload Coverage Report
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: php-coveralls --verbose --config tests/coveralls.yml

42 changes: 0 additions & 42 deletions .travis.yml

This file was deleted.

3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
"NepadaTests\\": "tests/"
}
},
"config": {
"platform-check": false
},
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
Expand Down
3 changes: 3 additions & 0 deletions tests/php.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[php]
extension=json.so
extension=tokenizer.so

0 comments on commit 8e9a4c7

Please sign in to comment.