Skip to content

Commit e37545d

Browse files
authored
Improve CI (#7)
* Improve CI * minor
1 parent e7816d4 commit e37545d

File tree

11 files changed

+174
-79
lines changed

11 files changed

+174
-79
lines changed

.github/FUNDING.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# These are supported funding model platforms
2+
3+
github: [Nyholm]

.github/workflows/.editorconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[*.yml]
2+
indent_size = 2

.github/workflows/ci.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Tests
2+
on: [ pull_request ]
3+
4+
jobs:
5+
phpunit:
6+
name: PHPUnit
7+
runs-on: ubuntu-latest
8+
strategy:
9+
max-parallel: 10
10+
matrix:
11+
php: [ '7.2', '7.3', '7.4', '8.0' ]
12+
sf_version: [ '3.4.*', '4.4.*', '5.3.*' ]
13+
14+
steps:
15+
- name: Set up PHP
16+
uses: shivammathur/[email protected]
17+
with:
18+
php-version: ${{ matrix.php }}
19+
coverage: none
20+
tools: flex
21+
22+
- name: Checkout code
23+
uses: actions/checkout@v2
24+
25+
- name: Download dependencies
26+
env:
27+
SYMFONY_REQUIRE: ${{ matrix.sf_version }}
28+
uses: ramsey/composer-install@v1
29+
30+
- name: Run tests
31+
run: ./vendor/bin/simple-phpunit
32+
33+
lowest:
34+
name: Lowest deps
35+
runs-on: ubuntu-latest
36+
steps:
37+
- name: Set up PHP
38+
uses: shivammathur/[email protected]
39+
with:
40+
php-version: 7.3
41+
coverage: none
42+
43+
- name: Checkout code
44+
uses: actions/checkout@v2
45+
46+
- name: Download dependencies
47+
with:
48+
dependency-versions: "lowest"
49+
uses: ramsey/composer-install@v1
50+
51+
- name: Run tests
52+
env:
53+
SYMFONY_DEPRECATIONS_HELPER: "max[self]=0"
54+
run: ./vendor/bin/simple-phpunit

.github/workflows/static.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
on: [pull_request]
2+
name: Static analysis
3+
4+
jobs:
5+
phpstan:
6+
name: PHPStan
7+
runs-on: ubuntu-20.04
8+
9+
steps:
10+
- name: Checkout code
11+
uses: actions/checkout@v2
12+
13+
- name: Setup PHP
14+
uses: shivammathur/setup-php@v2
15+
with:
16+
php-version: 8.0
17+
coverage: none
18+
tools: phpstan:0.12.92, cs2pr
19+
20+
- name: Download dependencies
21+
uses: ramsey/composer-install@v1
22+
23+
- name: PHPStan
24+
run: phpstan analyze --no-progress --error-format=checkstyle | cs2pr
25+
26+
php-cs-fixer:
27+
name: PHP-CS-Fixer
28+
runs-on: ubuntu-20.04
29+
30+
steps:
31+
- name: Checkout code
32+
uses: actions/checkout@v2
33+
34+
- name: Setup PHP
35+
uses: shivammathur/setup-php@v2
36+
with:
37+
php-version: 8.0
38+
coverage: none
39+
tools: php-cs-fixer:2.19.0, cs2pr
40+
41+
- name: PHP-CS-Fixer
42+
run: php-cs-fixer fix --dry-run --format=checkstyle | cs2pr
43+
44+
psalm:
45+
name: Psalm
46+
runs-on: ubuntu-20.04
47+
steps:
48+
- name: Checkout code
49+
uses: actions/checkout@v2
50+
51+
- name: Setup PHP
52+
uses: shivammathur/setup-php@v2
53+
with:
54+
php-version: 8.0
55+
coverage: none
56+
tools: vimeo/psalm:4.8.1
57+
58+
- name: Download dependencies
59+
uses: ramsey/composer-install@v1
60+
61+
- name: Psalm
62+
run: psalm --no-progress --output-format=github
63+
64+
composer-normalize:
65+
name: Composer Normalize
66+
runs-on: ubuntu-20.04
67+
68+
steps:
69+
- name: Setup PHP
70+
uses: shivammathur/setup-php@v2
71+
with:
72+
php-version: 8.0
73+
coverage: none
74+
tools: composer-normalize
75+
76+
- name: Checkout code
77+
uses: actions/checkout@v2
78+
79+
- name: Normalize
80+
run: composer-normalize --dry-run

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
/vendor/
22
/composer.lock
3-
/php_cs.cache
3+
/.php_cs.cache
44
.phpunit.result.cache

.scrutinizer.yml

Lines changed: 0 additions & 9 deletions
This file was deleted.

.travis.yml

Lines changed: 0 additions & 58 deletions
This file was deleted.

composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "happyr/entity-exists-validation-constraint",
3-
"description": "Verify that your entity exists",
43
"type": "library",
4+
"description": "Verify that your entity exists",
55
"license": "MIT",
66
"authors": [
77
{
@@ -14,12 +14,12 @@
1414
}
1515
],
1616
"require": {
17-
"php": "^7.2||^8.0",
18-
"symfony/validator": "^3.4 || ^4.3 || ^5.0",
19-
"doctrine/orm": "^2.4"
17+
"php": "^7.2 || ^8.0",
18+
"doctrine/orm": "^2.4",
19+
"symfony/validator": "^3.4 || ^4.4 || ^5.0 || ^6.0"
2020
},
2121
"require-dev": {
22-
"symfony/phpunit-bridge": "^4.3 || ^5.0"
22+
"symfony/phpunit-bridge": "^5.3"
2323
},
2424
"autoload": {
2525
"psr-4": {

phpstan.neon.dist

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#includes:
2+
# - phpstan-baseline.neon
3+
4+
parameters:
5+
level: 5
6+
reportUnmatchedIgnoredErrors: false
7+
paths:
8+
- src

psalm.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0"?>
2+
<psalm
3+
errorLevel="3"
4+
resolveFromConfigFile="true"
5+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
6+
xmlns="https://getpsalm.org/schema/config"
7+
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
8+
>
9+
<projectFiles>
10+
<directory name="src" />
11+
<ignoreFiles>
12+
<directory name="vendor" />
13+
</ignoreFiles>
14+
</projectFiles>
15+
</psalm>

0 commit comments

Comments
 (0)