Skip to content

Commit f96f8b5

Browse files
committed
Configures CI pipeline with code sniffing and code coverage reporting.
1 parent b09c935 commit f96f8b5

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

.travis.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
language: php
2+
3+
php:
4+
- '7.0'
5+
- '7.1'
6+
7+
# Install packages and create test coverage log directory.
8+
before_script:
9+
- composer install --dev --no-interaction
10+
- mkdir -p build/logs
11+
12+
# Check code formatting, run tests and generate test coverage report.
13+
script:
14+
- vendor/bin/phpcs ./src ./tests --extensions=php --standard=PSR2
15+
- vendor/bin/phpunit -d smmry_api_key=$SMMRY_API_KEY --coverage-clover build/logs/clover.xml
16+
17+
# Submit test coverage report to Coveralls.
18+
after_success:
19+
- vendor/bin/coveralls -v
20+
21+
# Cache composer bits for faster test suite runs.
22+
cache:
23+
directories:
24+
- $HOME/.composer/cache
25+
26+
notifications:
27+
email:
28+
on_success: change
29+
on_failure: always

phpunit.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,14 @@
2020
<exclude>./tests/Integration/TestCase.php</exclude>
2121
</testsuite>
2222
</testsuites>
23+
24+
<filter>
25+
<whitelist>
26+
<directory>./src</directory>
27+
<exclude>
28+
<directory>./tests</directory>
29+
<directory>./vendor</directory>
30+
</exclude>
31+
</whitelist>
32+
</filter>
2333
</phpunit>

0 commit comments

Comments
 (0)