Skip to content

Commit

Permalink
Merge pull request #103 from odan/build
Browse files Browse the repository at this point in the history
Update build
  • Loading branch information
odan committed Jul 12, 2024
2 parents 99a1353 + 7fa4150 commit 20fae35
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 78 deletions.
49 changes: 21 additions & 28 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,28 @@
name: Tests
name: tests

on: [push, pull_request]
on: [ push, pull_request ]

jobs:
tests:
name: Tests PHP ${{ matrix.php }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: [7.4, 8.0, 8.1, 8.2, 8.3]
include:
- php: 8.1
analysis: true
tests:
name: Tests PHP ${{ matrix.php }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: [ 7.4, 8.0, 8.1, 8.2, 8.3 ]

steps:
- name: Checkout
uses: actions/checkout@v2
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: xdebug
- name: Set up PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: xdebug

- name: Install dependencies with Composer
uses: ramsey/composer-install@v2
- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest

- name: Coding standards
if: matrix.analysis
run: vendor/bin/phpcs

- name: Tests
run: vendor/bin/phpunit --coverage-clover clover.xml
- name: Run test suite
run: composer test:all
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.DS_Store
composer.lock
phpunit.xml
vendor
.idea
composer.phar
Expand Down
102 changes: 53 additions & 49 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,52 +1,56 @@
{
"name": "slim/php-view",
"type": "library",
"description": "Render PHP view scripts into a PSR-7 Response object.",
"keywords": [
"slim",
"framework",
"view",
"template",
"php",
"phtml",
"renderer"
],
"license": "MIT",
"authors": [
{
"name": "Glenn Eggleton",
"email": "[email protected]"
}
],
"require": {
"php": "^7.4 || ^8.0",
"psr/http-message": "^1.1"
},
"require-dev": {
"phpunit/phpunit": "^9.6",
"slim/psr7": "^1.6",
"squizlabs/php_codesniffer": "^3.10"
},
"autoload": {
"psr-4": {
"Slim\\Views\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"Slim\\Tests\\": "tests"
}
},
"scripts": {
"test": [
"@phpcs",
"@phpunit"
],
"phpunit": "phpunit",
"phpcs": "phpcs",
"test:coverage": "phpunit --configuration phpunit.xml.dist --coverage-clover build/logs/clover.xml --coverage-html build/coverage"
},
"config": {
"sort-packages": true
"name": "slim/php-view",
"description": "Render PHP view scripts into a PSR-7 Response object.",
"license": "MIT",
"type": "library",
"keywords": [
"slim",
"framework",
"view",
"template",
"php",
"phtml",
"renderer"
],
"authors": [
{
"name": "Glenn Eggleton",
"email": "[email protected]"
}
],
"require": {
"php": "^7.4 || ^8.0",
"psr/http-message": "^1.1"
},
"require-dev": {
"phpstan/phpstan": "^1",
"phpunit/phpunit": "^9",
"slim/psr7": "^1.6",
"squizlabs/php_codesniffer": "^3.10"
},
"autoload": {
"psr-4": {
"Slim\\Views\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"Slim\\Tests\\": "tests"
}
},
"config": {
"sort-packages": true
},
"scripts": {
"sniffer:check": "phpcs --standard=phpcs.xml",
"sniffer:fix": "phpcbf --standard=phpcs.xml",
"stan": "phpstan analyse -c phpstan.neon --no-progress --ansi",
"test": "phpunit --configuration phpunit.xml --do-not-cache-result --colors=always",
"test:all": [
"@sniffer:check",
"@stan",
"@test"
],
"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"
}
}
5 changes: 5 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
parameters:
level: 5
paths:
- src
- tests
File renamed without changes.

0 comments on commit 20fae35

Please sign in to comment.