Skip to content

Commit

Permalink
feat: add support files
Browse files Browse the repository at this point in the history
feat: add infection/infection to support mutation tests

feat: ergebnis/phpunit-slow-test-detector to detect slow tests

style: apply ergebnis/composer-normalize over composer file

chore: add phive directory
  • Loading branch information
lotyp committed Apr 8, 2024
1 parent ebd154b commit 069a503
Show file tree
Hide file tree
Showing 12 changed files with 1,113 additions and 242 deletions.
5 changes: 5 additions & 0 deletions .github/SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Security Policy

## Reporting a Vulnerability

If you believe that you have found a security vulnerability, please send an email to `the@wayof.dev`. Ensure to include all details required to understand the severity of the issue.
10 changes: 8 additions & 2 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,18 @@
# this file is for the labeler workflow job
# Documentation https://github.com/marketplace/actions/labeler

"type: bug":
- head-branch: ['^bug', '^fix', 'bug', 'fix']

"type: enhancement":
- head-branch: ['^feature', '^feat', 'feature']

"type: documentation":
- changed-files:
- any-glob-to-any-file: [assets/**/*, .github/*, ./*.md]
- any-glob-to-any-file: ['assets/**/*', '.github/*', './*.md']

"type: maintenance":
- changed-files:
- any-glob-to-any-file: [tests/**/*, .github/workflows/*]
- any-glob-to-any-file: ['tests/**/*', '.github/workflows/*']

...
3 changes: 3 additions & 0 deletions .phive/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*
!.gitignore
!phars.xml
4 changes: 4 additions & 0 deletions .phive/phars.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<phive xmlns="https://phar.io/phive">
<phar name="composer-require-checker" version="^4.10.0" installed="4.10.0" location="./.phive/composer-require-checker" copy="false"/>
</phive>
1 change: 0 additions & 1 deletion .yamllint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ ignore: |
vendor/
docs/
# Overwrite above default rules
rules:
braces:
# Defaults
Expand Down
20 changes: 14 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,14 @@ help:

.EXPORT_ALL_VARIABLES:


#
# Default action
# Defines default command when `make` is executed without additional parameters
# ------------------------------------------------------------------------------------
all: install hooks
.PHONY: all


#
# System Actions
# ------------------------------------------------------------------------------------
env: ## Generate .env file from example, use `make env force=true`, to force re-create file
Expand All @@ -104,7 +104,7 @@ prepare:
mkdir -p .build/php-cs-fixer
.PHONY: prepare


#
# Docker Actions
# ------------------------------------------------------------------------------------
up: # Creates and starts containers, defined in docker-compose and override file
Expand Down Expand Up @@ -138,7 +138,7 @@ ssh: ## Login inside running docker container
$(APP_RUNNER) sh
.PHONY: ssh


#
# Composer
# ------------------------------------------------------------------------------------
install: ## Installs composer dependencies
Expand All @@ -149,8 +149,8 @@ update: ## Updates composer dependencies by running composer update command
$(APP_COMPOSER) update
.PHONY: update


# Code Quality, Git, Linting, Testing
#
# Code Quality, Git, Linting
# ------------------------------------------------------------------------------------
hooks: ## Install git hooks from pre-commit-config
pre-commit install
Expand Down Expand Up @@ -180,6 +180,13 @@ lint-stan-ci:
$(APP_COMPOSER) stan:ci
.PHONY: lint-stan-ci

#
# Testing
# ------------------------------------------------------------------------------------
infect: ## Runs mutation tests with infection/infection
$(APP_COMPOSER) infect
.PHONY: infect

test: ## Run project php-unit and pest tests
$(APP_COMPOSER) test
.PHONY: test
Expand All @@ -188,6 +195,7 @@ test-cc: ## Run project php-unit and pest tests in coverage mode and build repor
$(APP_COMPOSER) test:cc
.PHONY: test-cc

#
# Documentation
# ------------------------------------------------------------------------------------
docs-deps-update: ## Check for outdated dependencies and automatically update them using pnpm
Expand Down
3 changes: 3 additions & 0 deletions composer-require-checker.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"symbol-whitelist": []
}
61 changes: 36 additions & 25 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,31 @@
{
"name": "wayofdev/laravel-package-tpl",
"description": "PHP package template with GitHub Actions",
"type": "library",
"license": "MIT",
"homepage": "https://wayof.dev",
"support": {
"issues": "https://github.com/wayofdev/laravel-package-tpl/issues",
"source": "https://github.com/wayofdev/laravel-package-tpl"
},
"type": "library",
"authors": [
{
"name": "lotyp",
"email": "the@wayof.dev"
}
],
"homepage": "https://wayof.dev",
"support": {
"issues": "https://github.com/wayofdev/laravel-package-tpl/issues",
"source": "https://github.com/wayofdev/laravel-package-tpl",
"security": "https://github.com/wayofdev/laravel-package-tpl/blob/master/.github/SECURITY.md"
},
"require": {
"php": "^8.2",
"illuminate/contracts": "^10.48 || ^11.0"
},
"require-dev": {
"ergebnis/composer-normalize": "^2.42",
"ergebnis/phpunit-slow-test-detector": "^2.14",
"fakerphp/faker": "^1.23",
"infection/infection": "^0.28.1",
"larastan/larastan": "^2.9",
"orchestra/testbench": "^8.5 | ^9.0",
"orchestra/testbench": "^8.5 || ^9.0",
"pestphp/pest": "^2.34",
"pestphp/pest-plugin-laravel": "^2.3",
"phpstan/extension-installer": "^1.3",
Expand All @@ -33,6 +37,8 @@
"roave/security-advisories": "dev-latest",
"wayofdev/cs-fixer-config": "^1.2"
},
"minimum-stability": "dev",
"prefer-stable": true,
"autoload": {
"psr-4": {
"WayOfDev\\Package\\": "src/"
Expand All @@ -41,36 +47,41 @@
"autoload-dev": {
"psr-4": {
"WayOfDev\\App\\": "tests/app/",
"WayOfDev\\Tests\\": "tests/src/",
"WayOfDev\\Database\\Factories\\": "tests/database/factories/",
"WayOfDev\\Database\\Seeders\\": "tests/database/seeders/"
"WayOfDev\\Database\\Seeders\\": "tests/database/seeders/",
"WayOfDev\\Tests\\": "tests/src/"
}
},
"scripts": {
"cs:fix": "php vendor/bin/php-cs-fixer fix -v",
"cs:diff": "php vendor/bin/php-cs-fixer fix --dry-run -v --diff",
"test": "XDEBUG_MODE=coverage php vendor/bin/pest",
"test:cc": "XDEBUG_MODE=coverage php vendor/bin/pest --coverage",
"stan": "php vendor/bin/phpstan analyse --memory-limit=2G",
"stan:ci": "php vendor/bin/phpstan analyse --memory-limit=2G --error-format=github"
},
"config": {
"sort-packages": true,
"allow-plugins": {
"ergebnis/composer-normalize": true,
"phpstan/extension-installer": true,
"pestphp/pest-plugin": true
}
"infection/extension-installer": true,
"pestphp/pest-plugin": true,
"phpstan/extension-installer": true
},
"audit": {
"abandoned": "report"
},
"sort-packages": true
},
"extra": {
"composer-normalize": {
"indent-size": 4,
"indent-style": "space"
},
"laravel": {
"providers": [
"WayOfDev\\Package\\Bridge\\Laravel\\Providers\\PackageServiceProvider"
]
},
"composer-normalize": {
"indent-size": 4,
"indent-style": "space"
}
},
"scripts": {
"cs:diff": "php vendor/bin/php-cs-fixer fix --dry-run -v --diff",
"cs:fix": "php vendor/bin/php-cs-fixer fix -v",
"infect": "XDEBUG_MODE=coverage php vendor/bin/infection",
"stan": "php vendor/bin/phpstan analyse --memory-limit=2G",
"stan:ci": "php vendor/bin/phpstan analyse --memory-limit=2G --error-format=github",
"test": "XDEBUG_MODE=coverage php vendor/bin/pest",
"test:cc": "XDEBUG_MODE=coverage php vendor/bin/pest --coverage"
}
}
Loading

0 comments on commit 069a503

Please sign in to comment.