Skip to content

Commit 20fae35

Browse files
authored
Merge pull request #103 from odan/build
Update build
2 parents 99a1353 + 7fa4150 commit 20fae35

5 files changed

Lines changed: 79 additions & 78 deletions

File tree

.github/workflows/tests.yml

Lines changed: 21 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,28 @@
1-
name: Tests
1+
name: tests
22

3-
on: [push, pull_request]
3+
on: [ push, pull_request ]
44

55
jobs:
6-
tests:
7-
name: Tests PHP ${{ matrix.php }}
8-
runs-on: ubuntu-latest
9-
strategy:
10-
fail-fast: false
11-
matrix:
12-
php: [7.4, 8.0, 8.1, 8.2, 8.3]
13-
include:
14-
- php: 8.1
15-
analysis: true
6+
tests:
7+
name: Tests PHP ${{ matrix.php }}
8+
runs-on: ubuntu-latest
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
php: [ 7.4, 8.0, 8.1, 8.2, 8.3 ]
1613

17-
steps:
18-
- name: Checkout
19-
uses: actions/checkout@v2
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v2
2017

21-
- name: Set up PHP ${{ matrix.php }}
22-
uses: shivammathur/setup-php@v2
23-
with:
24-
php-version: ${{ matrix.php }}
25-
coverage: xdebug
18+
- name: Set up PHP ${{ matrix.php }}
19+
uses: shivammathur/setup-php@v2
20+
with:
21+
php-version: ${{ matrix.php }}
22+
coverage: xdebug
2623

27-
- name: Install dependencies with Composer
28-
uses: ramsey/composer-install@v2
24+
- name: Install dependencies
25+
run: composer install --prefer-dist --no-progress --no-suggest
2926

30-
- name: Coding standards
31-
if: matrix.analysis
32-
run: vendor/bin/phpcs
33-
34-
- name: Tests
35-
run: vendor/bin/phpunit --coverage-clover clover.xml
27+
- name: Run test suite
28+
run: composer test:all

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
.DS_Store
22
composer.lock
3-
phpunit.xml
43
vendor
54
.idea
65
composer.phar

composer.json

Lines changed: 53 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,56 @@
11
{
2-
"name": "slim/php-view",
3-
"type": "library",
4-
"description": "Render PHP view scripts into a PSR-7 Response object.",
5-
"keywords": [
6-
"slim",
7-
"framework",
8-
"view",
9-
"template",
10-
"php",
11-
"phtml",
12-
"renderer"
13-
],
14-
"license": "MIT",
15-
"authors": [
16-
{
17-
"name": "Glenn Eggleton",
18-
"email": "geggleto@gmail.com"
19-
}
20-
],
21-
"require": {
22-
"php": "^7.4 || ^8.0",
23-
"psr/http-message": "^1.1"
24-
},
25-
"require-dev": {
26-
"phpunit/phpunit": "^9.6",
27-
"slim/psr7": "^1.6",
28-
"squizlabs/php_codesniffer": "^3.10"
29-
},
30-
"autoload": {
31-
"psr-4": {
32-
"Slim\\Views\\": "src"
33-
}
34-
},
35-
"autoload-dev": {
36-
"psr-4": {
37-
"Slim\\Tests\\": "tests"
38-
}
39-
},
40-
"scripts": {
41-
"test": [
42-
"@phpcs",
43-
"@phpunit"
44-
],
45-
"phpunit": "phpunit",
46-
"phpcs": "phpcs",
47-
"test:coverage": "phpunit --configuration phpunit.xml.dist --coverage-clover build/logs/clover.xml --coverage-html build/coverage"
48-
},
49-
"config": {
50-
"sort-packages": true
2+
"name": "slim/php-view",
3+
"description": "Render PHP view scripts into a PSR-7 Response object.",
4+
"license": "MIT",
5+
"type": "library",
6+
"keywords": [
7+
"slim",
8+
"framework",
9+
"view",
10+
"template",
11+
"php",
12+
"phtml",
13+
"renderer"
14+
],
15+
"authors": [
16+
{
17+
"name": "Glenn Eggleton",
18+
"email": "geggleto@gmail.com"
19+
}
20+
],
21+
"require": {
22+
"php": "^7.4 || ^8.0",
23+
"psr/http-message": "^1.1"
24+
},
25+
"require-dev": {
26+
"phpstan/phpstan": "^1",
27+
"phpunit/phpunit": "^9",
28+
"slim/psr7": "^1.6",
29+
"squizlabs/php_codesniffer": "^3.10"
30+
},
31+
"autoload": {
32+
"psr-4": {
33+
"Slim\\Views\\": "src"
5134
}
35+
},
36+
"autoload-dev": {
37+
"psr-4": {
38+
"Slim\\Tests\\": "tests"
39+
}
40+
},
41+
"config": {
42+
"sort-packages": true
43+
},
44+
"scripts": {
45+
"sniffer:check": "phpcs --standard=phpcs.xml",
46+
"sniffer:fix": "phpcbf --standard=phpcs.xml",
47+
"stan": "phpstan analyse -c phpstan.neon --no-progress --ansi",
48+
"test": "phpunit --configuration phpunit.xml --do-not-cache-result --colors=always",
49+
"test:all": [
50+
"@sniffer:check",
51+
"@stan",
52+
"@test"
53+
],
54+
"test:coverage": "php -d xdebug.mode=coverage -r \"require 'vendor/bin/phpunit';\" -- --configuration phpunit.xml --do-not-cache-result --colors=always --coverage-clover build/logs/clover.xml --coverage-html build/coverage"
55+
}
5256
}

phpstan.neon

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
parameters:
2+
level: 5
3+
paths:
4+
- src
5+
- tests
File renamed without changes.

0 commit comments

Comments
 (0)