Skip to content

Commit

Permalink
Merge pull request #26 from Smolevich/use-github-actions
Browse files Browse the repository at this point in the history
Use GitHub actions
  • Loading branch information
jenssegers authored Apr 6, 2020
2 parents 0a0e307 + f0a2b5e commit 5d1988b
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 2 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: CI

on:
push:
pull_request:

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
php: [7.1, 7.2, 7.3]
steps:
- uses: actions/checkout@v2
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: pecl
extensions: xdebug
- name: Show php version
run: php -v && composer -V
- name: Debug if needed
run: if [[ "$DEBUG" == "true" ]]; then env; fi
env:
DEBUG: ${{secrets.DEBUG}}
- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache dependencies
uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ matrix.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ matrix.os }}-composer-
- name: Install dependencies
run: composer install --prefer-source
- name: Run unit tests
run: ./vendor/bin/phpunit --coverage-clover build/logs/clover.xml
- name: Run Coverage
run: ./vendor/bin/php-coveralls -v
env:
COVERALLS_RUN_LOCALLY: ${{ secrets.COVERALLS_RUN_LOCALLY }}
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
continue-on-error: true
- name: show coverage json
run: cat build/logs/coveralls-upload.json
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.DS_Store
/vendor
build/logs
phpunit.phar
composer.lock
.phpunit.result.cache
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ script:
- ./vendor/bin/phpunit --coverage-clover build/logs/clover.xml

after_success:
- sh -c 'if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then php vendor/bin/coveralls -v; fi;'
- sh -c 'if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then php vendor/bin/php-coveralls -v; fi;'
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Installation

Install using composer:

```
```bash
composer require jenssegers/model
```

Expand Down
8 changes: 8 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,12 @@
<directory>tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./src</directory>
</whitelist>
</filter>
<logging>
<log type="coverage-clover" target="build/logs/clover.xml"/>
</logging>
</phpunit>

0 comments on commit 5d1988b

Please sign in to comment.