Skip to content

Commit 3ddc5ca

Browse files
authored
Merge pull request #90 from Nyholm/init-ci
Added some simple CI
2 parents 2484d3f + ff5e7a3 commit 3ddc5ca

File tree

12 files changed

+244
-36
lines changed

12 files changed

+244
-36
lines changed

.editorconfig

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# EditorConfig is awesome: http://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
[*]
7+
charset = utf-8
8+
end_of_line = lf
9+
indent_size = 4
10+
indent_style = space
11+
insert_final_newline = true
12+
trim_trailing_whitespace = true
13+
14+
[Makefile]
15+
indent_style = tab
16+
17+
[phpunit.xml.dist]
18+
indent_size = 2

.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: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: CI
2+
3+
on:
4+
pull_request: ~
5+
push:
6+
branches:
7+
- master
8+
9+
jobs:
10+
11+
build:
12+
name: Build
13+
runs-on: ubuntu-latest
14+
strategy:
15+
fail-fast: false
16+
17+
steps:
18+
- name: Set up PHP
19+
uses: shivammathur/[email protected]
20+
with:
21+
php-version: 7.4
22+
coverage: none
23+
24+
- name: Checkout code
25+
uses: actions/checkout@v2
26+
27+
- name: Download dependencies
28+
run: |
29+
composer install --no-interaction --optimize-autoloader
30+
./vendor/bin/simple-phpunit install
31+
32+
- name: Run tests
33+
env:
34+
SYMFONY_REQUIRE: 4.4.*
35+
GITHUB_TOKEN: ${{ secrets.CARSONTEST_GITHUB_TOKEN }}
36+
run: |
37+
./vendor/bin/simple-phpunit

.github/workflows/static.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Static analysis
2+
3+
on:
4+
pull_request: ~
5+
push:
6+
branches:
7+
- master
8+
9+
jobs:
10+
phpstan:
11+
name: PHPStan
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Set up PHP
16+
uses: shivammathur/[email protected]
17+
with:
18+
php-version: '7.4'
19+
coverage: none
20+
21+
- name: Checkout code
22+
uses: actions/checkout@v2
23+
24+
- name: Download dependencies
25+
run: composer install --no-interaction --optimize-autoloader
26+
27+
- name: PHPStan
28+
uses: docker://oskarstark/phpstan-ga:0.12.48
29+
with:
30+
entrypoint: /composer/vendor/bin/phpstan
31+
args: analyze --no-progress
32+
33+
php-cs-fixer:
34+
name: PHP-CS-Fixer
35+
runs-on: ubuntu-latest
36+
37+
steps:
38+
- name: Checkout code
39+
uses: actions/checkout@v2
40+
41+
- name: PHP-CS-Fixer
42+
uses: docker://oskarstark/php-cs-fixer-ga:2.16.4
43+
with:
44+
args: --dry-run --diff-format udiff
45+
46+
psalm:
47+
name: Psalm
48+
runs-on: ubuntu-latest
49+
steps:
50+
- name: Checkout code
51+
uses: actions/checkout@v2
52+
53+
- name: Psalm
54+
uses: docker://vimeo/psalm-github-actions:3.17.2
55+
with:
56+
args: --no-progress --show-info=false --stats

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,5 @@
1313
/var/
1414
/vendor/
1515
###< symfony/framework-bundle ###
16+
17+
.php_cs.cache

.php_cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
$finder = PhpCsFixer\Finder::create()
4+
->in(__DIR__.'/src')
5+
->in(__DIR__.'/tests')
6+
;
7+
8+
return PhpCsFixer\Config::create()
9+
->setRiskyAllowed(false)
10+
->setRules([
11+
'@PSR2' => true,
12+
'@Symfony' => true,
13+
'array_syntax' => ['syntax' => 'short'],
14+
])
15+
->setFinder($finder)
16+
;

composer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@
99
"nyholm/psr7": "^1.3",
1010
"sensio/framework-extra-bundle": "^5.1",
1111
"symfony/console": "^5.1",
12+
"symfony/dotenv": "^5.1",
1213
"symfony/flex": "^1.8",
1314
"symfony/framework-bundle": "^5.1",
1415
"symfony/http-client": "^5.1",
1516
"symfony/monolog-bundle": "~3.5",
17+
"symfony/security-core": "5.1.*",
1618
"symfony/twig-pack": "^1.0",
17-
"symfony/yaml": "^5.1",
18-
"symfony/dotenv": "^5.1"
19+
"symfony/yaml": "^5.1"
1920
},
2021
"conflict": {
2122
"symfony/symfony": "*"

composer.lock

Lines changed: 86 additions & 34 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

phpstan.neon.dist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
parameters:
2+
level: 5
3+
paths:
4+
- 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)