Skip to content

Commit ae6993d

Browse files
committed
Switch to Github Actions
1 parent 29a3161 commit ae6993d

File tree

4 files changed

+87
-41
lines changed

4 files changed

+87
-41
lines changed

.github/workflows/tests.yml

+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Tests
2+
3+
on:
4+
push: ~
5+
pull_request: ~
6+
7+
jobs:
8+
phpcs:
9+
name: PHPCS
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v2
14+
15+
- uses: shivammathur/setup-php@v2
16+
with:
17+
php-version: 7.1
18+
extensions: curl, mbstring
19+
coverage: none
20+
tools: composer:v2, cs2pr
21+
22+
- run: composer update --no-progress
23+
24+
- run: vendor/bin/phpcs --standard=psr2 -q --report=checkstyle src | cs2pr
25+
26+
phpunit:
27+
name: PHPUnit on ${{ matrix.php }} ${{ matrix.composer-flags }}
28+
runs-on: ubuntu-latest
29+
strategy:
30+
matrix:
31+
php: ['7.1', '7.2', '7.3', '7.4', '8.0']
32+
coverage: [true]
33+
composer-flags: ['']
34+
include:
35+
- php: '7.1'
36+
coverage: false
37+
composer-flags: '--prefer-lowest'
38+
39+
steps:
40+
- uses: actions/checkout@v2
41+
42+
- uses: shivammathur/setup-php@v2
43+
with:
44+
php-version: ${{ matrix.php }}
45+
extensions: curl, mbstring
46+
coverage: xdebug
47+
tools: composer:v2
48+
49+
- run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
50+
51+
- run: composer update --no-progress ${{ matrix.composer-flags }}
52+
53+
- run: vendor/bin/simple-phpunit --no-coverage
54+
if: ${{ !matrix.coverage }}
55+
56+
- run: vendor/bin/simple-phpunit --coverage-text --coverage-clover=coverage.clover
57+
if: ${{ matrix.coverage }}
58+
59+
- run: php vendor/bin/ocular code-coverage:upload --format=php-clover coverage.clover
60+
if: ${{ matrix.coverage }}
61+
62+
phpstan:
63+
name: PHPStan
64+
runs-on: ubuntu-latest
65+
66+
steps:
67+
- uses: actions/checkout@v2
68+
69+
- uses: shivammathur/setup-php@v2
70+
with:
71+
php-version: 7.1
72+
extensions: curl, mbstring
73+
coverage: none
74+
tools: composer:v2
75+
76+
- run: composer update --no-progress
77+
78+
- run: vendor/bin/phpstan analyse -l 3 src --no-progress

.travis.yml

-37
This file was deleted.

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# JSON5 for PHP - JSON for Humans
22

33
[![Latest Version on Packagist][ico-version]][link-packagist]
4-
[![PHP 5.4+][ico-php]][link-packagist]
4+
[![PHP 7.1+][ico-php]][link-packagist]
55
[![Software License][ico-license]](LICENSE.md)
6-
[![Build Status][ico-travis]][link-travis]
6+
[![Build Status][ico-build-status]][link-build-status]
77
[![Coverage Status][ico-scrutinizer]][link-scrutinizer]
88
[![SensioLabs Insight][ico-sensio]][link-sensio]
99
![UTF-8 Compatible][ico-utf8]
@@ -146,7 +146,7 @@ The MIT License (MIT). Please see [License File](LICENSE.md) for more informatio
146146

147147
[ico-version]: https://img.shields.io/packagist/v/colinodell/json5.svg?style=flat-square
148148
[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square
149-
[ico-travis]: https://img.shields.io/travis/colinodell/json5/master.svg?style=flat-square
149+
[ico-build-status]: https://img.shields.io/github/workflow/status/colinodell/json5/Tests/latest.svg?style=flat-square
150150
[ico-scrutinizer]: https://img.shields.io/scrutinizer/coverage/g/colinodell/json5.svg?style=flat-square
151151
[ico-code-quality]: https://img.shields.io/scrutinizer/g/colinodell/json5.svg?style=flat-square
152152
[ico-downloads]: https://img.shields.io/packagist/dt/colinodell/json5.svg?style=flat-square
@@ -155,7 +155,7 @@ The MIT License (MIT). Please see [License File](LICENSE.md) for more informatio
155155
[ico-php]: https://img.shields.io/packagist/php-v/colinodell/json5.svg?style=flat-square
156156

157157
[link-packagist]: https://packagist.org/packages/colinodell/json5
158-
[link-travis]: https://travis-ci.org/colinodell/json5
158+
[link-build-status]: https://github.com/colinodell/json5/actions?query=workflow%3ATests+branch%3Alatest
159159
[link-scrutinizer]: https://scrutinizer-ci.com/g/colinodell/json5/code-structure/master/code-coverage
160160
[link-code-quality]: https://scrutinizer-ci.com/g/colinodell/json5
161161
[link-downloads]: https://packagist.org/packages/colinodell/json5

composer.json

+5
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,15 @@
2525
},
2626
"require-dev": {
2727
"mikehaertl/php-shellcommand": "^1.2.5",
28+
"phpstan/phpstan": "^0.12.58",
29+
"scrutinizer/ocular": "^1.6",
2830
"squizlabs/php_codesniffer": "^2.3",
2931
"symfony/finder": "^4.4|^5.2",
3032
"symfony/phpunit-bridge": "^5.1"
3133
},
34+
"conflict": {
35+
"scrutinizer/ocular": "1.7.*"
36+
},
3237
"autoload": {
3338
"psr-4": {
3439
"ColinODell\\Json5\\": "src"

0 commit comments

Comments
 (0)