Skip to content

Commit 9072d6c

Browse files
committed
Add compatibility test to CircleCI
1 parent 3fddd59 commit 9072d6c

File tree

3 files changed

+47
-7
lines changed

3 files changed

+47
-7
lines changed

.circleci/config.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,18 @@ commands:
2020
paths:
2121
- vendor
2222

23-
jobs:
24-
php_7:
25-
docker:
23+
jobs:
24+
php_7:
25+
docker:
2626
- image: circleci/php:7.1
2727
steps:
2828
- prepare
29+
- run:
30+
name: Check PHP Compatibility
31+
command: composer phpcs
32+
- run:
33+
name: Run Tests
34+
command: composer test
2935
snyk:
3036
docker:
3137
- image: snyk/snyk-cli:composer
@@ -48,6 +54,6 @@ workflows:
4854
- php_7
4955
- snyk:
5056
# Must define SNYK_TOKEN env
51-
context: snyk-env
52-
requires:
53-
- php_7
57+
context: snyk-env
58+
requires:
59+
- php_7

.phpcs.xml.dist

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0"?>
2+
<ruleset name="Laravel-Auth0" namespace="Auth0PHP\CS\Standard">
3+
<description>A custom coding standard for the Laravel Auth0 package</description>
4+
5+
<file>./src</file>
6+
7+
<!-- Only check PHP files. -->
8+
<arg name="extensions" value="php"/>
9+
10+
<!-- Show progress, show the error codes for each message (source). -->
11+
<arg value="sp"/>
12+
13+
<!-- Strip the filepaths down to the relevant bit. -->
14+
<arg name="basepath" value="."/>
15+
16+
<!-- Show coloured output, if available. -->
17+
<arg name="colors"/>
18+
19+
<!--
20+
PHPCompatibility sniffs to check for PHP cross-version incompatible code.
21+
https://github.com/PHPCompatibility/PHPCompatibility
22+
-->
23+
<config name="testVersion" value="5.5-"/>
24+
<rule ref="PHPCompatibility"/>
25+
26+
</ruleset>

composer.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,15 @@
99
"illuminate/contracts": "5.* | ^6.0"
1010
},
1111
"require-dev": {
12-
"phpunit/phpunit": "^4 | ^7"
12+
"phpunit/phpunit": "^4 | ^7",
13+
"squizlabs/php_codesniffer": "^3.2",
14+
"phpcompatibility/php-compatibility": "^8.1",
15+
"dealerdirect/phpcodesniffer-composer-installer": "^0.5.0"
16+
},
17+
"scripts": {
18+
"test": "SHELL_INTERACTIVE=1 \"vendor/bin/phpunit\" --coverage-text ",
19+
"phpcs": "\"vendor/bin/phpcs\"",
20+
"sniffs": "\"vendor/bin/phpcs\" -e"
1321
},
1422
"autoload": {
1523
"classmap": [

0 commit comments

Comments
 (0)