chore: initialize project using ramsey/php-library-starter-kit

This commit is contained in:
Dan Jones 2021-10-14 15:41:02 -05:00
commit 3d602ddd69
35 changed files with 1119 additions and 0 deletions

0
.github/CODEOWNERS vendored Normal file
View file

0
.github/FUNDING.yml vendored Normal file
View file

35
.github/ISSUE_TEMPLATE/Bug_Report.md vendored Normal file
View file

@ -0,0 +1,35 @@
---
name: Bug Report
about: Create a bug report to help us improve
labels: bug
assignees:
---
<!--- Provide a general summary of the issue you're having in the title above. -->
## Description
<!-- Provide a short and clear description of the bug. -->
## Steps to reproduce
<!--
Provide steps to reproduce the behavior you are experiencing. Please try to keep
this as short as possible. If able, create a reproducible script outside of any
framework you are using. This will help us to quickly debug the issue.
-->
1. Step one...
2. Step two...
3. Step three...
## Expected behavior
<!-- Provide a short and clear description of what you expect to happen. -->
## Screenshots or output
<!-- If applicable, add screenshots or program output to help explain your problem. -->
## Environment details
<!-- Provide details about the system where you're using this package. -->
- version of this package: *e.g. 1.0.0, 1.0.1, 1.1.0*
- PHP version: *e.g. 7.3.16, 7.4.4*
- OS: *e.g. Windows 10, Linux (Ubuntu 18.04.1), macOS Catalina (10.15.3)*
## Additional context
<!-- Provide any additional context that may help us debug the problem. -->

View file

@ -0,0 +1,31 @@
---
name: Feature Request
about: Suggest a feature for this project
labels: enhancement
assignees:
---
<!--- Provide a general summary of your feature request in the title above. -->
<!-- Give your feature a short title here. -->
## My feature title
<!-- Provide a short and clear description of the feature. -->
## Background/problem
<!--
Provide background details to show why this feature is necessary. Is your
feature request related to a problem? If so, please describe the problem.
Provide as much detail as possible.
-->
## Proposal/solution
<!--
Provide a short and clear description of the solution you'd like. Include code
examples, if possible. Feel free to use pseudo-code to show how you think the
feature should work.
-->
## Alternatives
<!-- Describe any alternative solutions or features you've considered. -->
## Additional context
<!-- Please provide any other context or code examples that may help. -->

19
.github/ISSUE_TEMPLATE/Question.md vendored Normal file
View file

@ -0,0 +1,19 @@
---
name: Question
about: Ask a question about how to use this library
labels: question
assignees:
---
<!--- Provide a general summary of your question in the title above. -->
<!-- Write your question here. -->
## How do I... ?
<!-- Provide any additional context that may help us answer your question. -->
## Example code
<!--
If your question is about code that you've written, provide a short and clear
example of what you're trying to accomplish. Try to keep this as short as
possible. If able, please provide an example outside of any framework you are
using. This will help us to quickly respond to your question.
-->

1
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View file

@ -0,0 +1 @@
blank_issues_enabled: false

7
.github/dependabot.yml vendored Normal file
View file

@ -0,0 +1,7 @@
version: 2
updates:
- package-ecosystem: "composer"
directory: "/"
schedule:
interval: "monthly"
versioning-strategy: "increase-if-necessary"

27
.github/pull_request_template.md vendored Normal file
View file

@ -0,0 +1,27 @@
<!--- Provide a general summary of your changes in the title above. -->
## Description
<!--- Describe your changes in detail. -->
## Motivation and context
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here. -->
## How has this been tested?
<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran to -->
<!--- see how your change affects other areas of the code, etc. -->
## Types of changes
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
## PR checklist
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [ ] I have read the **CONTRIBUTING.md** document.
- [ ] I have added tests to cover my changes.

View file

@ -0,0 +1,148 @@
# GitHub Actions Documentation: https://docs.github.com/en/actions
name: "build"
on: ["pull_request", "push"]
env:
COMPOSER_ROOT_VERSION: "1.99.99"
jobs:
coding-standards:
name: "Coding standards"
runs-on: "ubuntu-latest"
steps:
- name: "Checkout repository"
uses: "actions/checkout@v2"
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "latest"
coverage: "none"
- name: "Install dependencies (Composer)"
uses: "ramsey/composer-install@v1"
- name: "Check syntax (php-parallel-lint)"
run: "composer dev:lint:syntax"
- name: "Check coding standards (PHP_CodeSniffer)"
run: "composer dev:lint:style"
static-analysis:
name: "Static analysis"
runs-on: "ubuntu-latest"
steps:
- name: "Checkout repository"
uses: "actions/checkout@v2"
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "latest"
coverage: "none"
- name: "Install dependencies (Composer)"
uses: "ramsey/composer-install@v1"
- name: "Statically analyze code (PHPStan)"
run: "composer dev:analyze:phpstan"
- name: "Statically analyze code (Psalm)"
run: "composer dev:analyze:psalm -- --shepherd"
security-analysis:
name: "Security analysis"
runs-on: "ubuntu-latest"
steps:
- name: "Checkout repository"
uses: "actions/checkout@v2"
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "latest"
coverage: "none"
- name: "Install dependencies (Composer)"
uses: "ramsey/composer-install@v1"
- name: "Analyze security of code (Psalm)"
run: "./vendor/bin/psalm --taint-analysis --report=build/logs/psalm.sarif"
- name: "Upload security analysis results to GitHub"
uses: "github/codeql-action/upload-sarif@v1"
with:
sarif_file: "build/logs/psalm.sarif"
code-coverage:
name: "Code coverage"
runs-on: "ubuntu-latest"
steps:
- name: "Checkout repository"
uses: "actions/checkout@v2"
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "latest"
coverage: "pcov"
ini-values: "memory_limit=-1"
- name: "Install dependencies (Composer)"
uses: "ramsey/composer-install@v1"
- name: "Run unit tests (PHPUnit)"
run: "composer dev:test:coverage:ci"
- name: "Publish coverage report to Codecov"
uses: "codecov/codecov-action@v1"
unit-tests:
name: "Unit tests"
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
php-version:
- "7.4"
- "8.0"
operating-system:
- "macos-latest"
- "ubuntu-latest"
- "windows-latest"
dependencies:
- "lowest"
- "highest"
include:
- php-version: "8.1"
operating-system: "ubuntu-latest"
dependencies: "highest"
composer-options: "--ignore-platform-req=php"
steps:
- name: "Configure Git (for Windows)"
if: ${{ matrix.operating-system == 'windows-latest' }}
run: |
git config --system core.autocrlf false
git config --system core.eol lf
- name: "Checkout repository"
uses: "actions/checkout@v2"
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php-version }}"
coverage: "none"
- name: "Install dependencies (Composer)"
uses: "ramsey/composer-install@v1"
with:
dependency-versions: "${{ matrix.dependencies }}"
composer-options: "${{ matrix.composer-options }}"
- name: "Run unit tests (PHPUnit)"
run: "composer dev:test:unit"