Skip to content

Commit

Permalink
chore: bring repo more in line with my other repos
Browse files Browse the repository at this point in the history
  • Loading branch information
ericsizemore committed Feb 7, 2025
1 parent 2d35445 commit 07b72ce
Show file tree
Hide file tree
Showing 39 changed files with 1,754 additions and 401 deletions.
31 changes: 20 additions & 11 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
# Set the default behavior, in case people don't have core.autocrlf set.
* text eol=lf
*.php text diff=php
*.md text diff=markdown

# Ignore all test and documentation with "export-ignore".
/.github export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.scrutinizer.yml export-ignore
/.php-cs-fixer.dist.php export-ignore
/tests export-ignore
/composer.lock export-ignore
/phpstan.neon export-ignore
/phpunit.xml export-ignore
/renovate.json export-ignore
/psalm.xml export-ignore
/.github export-ignore
/tests export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.php-cs-fixer.dist.php export-ignore
/.scrutinizer.yml export-ignore
/backward-compatibility.md export-ignore
/CHANGELOG.md export-ignore
/CODE_OF_CONDUCT.md export-ignore
/composer.lock export-ignore
/CONTRIBUTING.md export-ignore
/phpstan.neon export-ignore
/phpstan-baseline.neon export-ignore
/phpunit.xml export-ignore
/psalm.xml export-ignore
/psalm-baseline.xml export-ignore
/rector.php export-ignore
/renovate.json export-ignore
58 changes: 58 additions & 0 deletions .github/ISSUE_TEMPLATE/1-bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Bug Report
description: Existing feature does not behave as expected.
labels: [ "bug", "unverified" ]
body:
- type: markdown
attributes:
value: |
Before reporting a bug, make sure Numverify is up-to-date and the problem is/was not reported already.
- type: textarea
id: problem-description
attributes:
label: Problem description
description: Please describe the problem you have encountered
validations:
required: true
- type: textarea
id: minimal-reproducer
attributes:
label: Minimal Reproducer
description: |
Please provide a minimal code snippet that should be run to reproduce the problem.
If relevant, provide the expected output, the actual output and/or the error that occurred, if any.
Please use markdown syntax for each code snippet.
validations:
required: true
- type: input
id: version
attributes:
label: Library Version
description: Which version of Numverify is being run? (in X.Y.Z format)
validations:
required: true
- type: input
id: php-version
attributes:
label: PHP version
description: Which PHP version is Numverify being run on?
validations:
required: true
- type: dropdown
id: run-method
attributes:
label: How do you run Numverify?
multiple: false
options:
- Composer package
- Manual installation
validations:
required: true
- type: checkboxes
id: terms
attributes:
label: Contribution Checks
options:
- label: I have verified whether this problem has already been reported.
required: false
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/2-feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Feature Request
description: I have a suggestion for a new feature (and possibly want to implement it).
labels: [ "enhancement", "unverified" ]
body:
- type: markdown
attributes:
value: |
> [!IMPORTANT]
> Before requesting a new feature, make sure your version of Numverify is up-to-date.
- type: textarea
id: feature-request
attributes:
label: Feature Request
description: Please describe the feature you would like to see implemented.
validations:
required: true
- type: checkboxes
id: terms
attributes:
label: Contribution Checks
options:
- label: I have verified whether this feature request was already discussed.
required: false
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Support question?
url: https://github.com/ericsizemore/numverify-api-client-php/discussions/categories/q-a
about: If you have any questions about configuring or using Numverify, please open a new Q&A discussion.
28 changes: 28 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Pull Request
<!--
PR title needs to be prefixed with a conventional commit type
(chore,ci,deprecate,docs,feat,fix,refactor,revert)
It should also be brief and descriptive for a good changelog entry
examples: "feat: add new implementation" or "fix: remove unused imports"
-->

## Proposed Changes
<!-- Describe what the changes are and link to a Discussion or Issue if one exists -->

## Readiness Checklist

### Author/Contributor

- [ ] You have read [CONTRIBUTING](https://github.com/ericsizemore/numverify-api-client-php/blob/master/CONTRIBUTING.md).
- [ ] If documentation is needed for this change, has that been included in this pull request?
- [ ] run `composer run-script phpunit` and ensure you have test coverage for the lines you are introducing.
- [ ] run `composer run-script phpstan` and fix any issues that you have introduced.
- [ ] run `composer run-script psalm` and fix any issues that you have introduced.
- [ ] run `composer run-script phpcs:check` and fix any issues that you have introduced.

### Reviewer

- [ ] Label as either `fix`, `documentation`, or `enhancement`.
- [ ] Additionally label as `verified` or `unverified`.
47 changes: 0 additions & 47 deletions .github/workflows/analysis.yml

This file was deleted.

108 changes: 108 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
name: "Continuous Integration"

on:
workflow_dispatch:
push:
branches: [ master ]
pull_request:
branches: [ master ]

# Cancels all previous workflow runs for the same branch that have not yet completed.
concurrency:
# The concurrency group contains the workflow name and the branch name.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
COMPOSER_ROOT_VERSION: "3.99.99"

jobs:
phpstan:
name: "PHPStan Static Analysis ${{ matrix.php }}"
runs-on: ubuntu-latest
strategy:
matrix:
php: [ '8.2', '8.3', '8.4' ]
steps:
- uses: actions/checkout@v4

- name: "Install PHP ${{ matrix.php }}"
uses: shivammathur/setup-php@master
with:
php-version: ${{ matrix.php }}
extensions: mbstring

- name: "Validate composer.json and composer.lock"
run: composer validate --strict

- name: "Setup Composer, install dependencies"
uses: ramsey/composer-install@v3
with:
composer-options: "--prefer-dist --optimize-autoloader"
require-lock-file: "true"

- name: "Run PHPStan"
run: composer run-script phpstan

psalm:
name: "Psalm"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: "Psalm Analysis"
uses: docker://vimeo/psalm-github-actions:latest
with:
args: --shepherd
composer_require_dev: true
security_analysis: true
report_file: results.sarif

- name: "Upload Security Analysis results to GitHub"
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: results.sarif

unit-test:
name: "Run Unit Tests ${{ matrix.php }}"
runs-on: ubuntu-latest
strategy:
matrix:
php: [ '8.2', '8.3', '8.4' ]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 10

- name: "Install PHP ${{ matrix.php }}"
uses: shivammathur/setup-php@master
with:
php-version: ${{ matrix.php }}
extensions: mbstring,
coverage: xdebug

- name: "Validate composer.json and composer.lock"
run: composer validate --strict

- name: "Setup Composer, install dependencies"
uses: ramsey/composer-install@v3
with:
composer-options: "--prefer-dist --optimize-autoloader"
require-lock-file: "true"

- name: "Run test suite"
run: composer run-script phpunit

- name: "Coverage check"
run: composer run-script code-coverage

- name: "Upload coverage reports to Scrutinizer"
uses: sudo-bot/action-scrutinizer@latest
with:
cli-args: "--format=php-clover build/logs/clover.xml"

- name: "Upload coverage reports to Codecov"
uses: codecov/codecov-action@v5.3.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: ericsizemore/numverify-api-client-php
23 changes: 0 additions & 23 deletions .github/workflows/psalm.yml

This file was deleted.

61 changes: 0 additions & 61 deletions .github/workflows/tests.yml

This file was deleted.

Loading

0 comments on commit 07b72ce

Please sign in to comment.