This repository has been archived by the owner on Mar 6, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhancement: Synchronize project tooling configuration with localhein…
…z/php-library-template
- Loading branch information
1 parent
943ef44
commit 10b98df
Showing
11 changed files
with
168 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,75 +1,36 @@ | ||
# CONTRIBUTING | ||
|
||
We are using [Travis CI](https://travis-ci.com) as a continuous integration system. | ||
We are using [GitHub Actions](https://github.com/features/actions) as continuous integration system. | ||
|
||
For details, see [`.travis.yml`](../.travis.yml). | ||
For details, see | ||
|
||
## Coding Standards | ||
* [`workflows/continuous-integration.yml`](workflows/continuous-integration.yml). | ||
* [`workflows/continuous-deployment.yml`](workflows/continuous-deployment.yml). | ||
|
||
We are using [`friendsofphp/php-cs-fixer`](https://github.com/FriendsOfPHP/PHP-CS-Fixer) to enforce coding standards. | ||
## Docker Image | ||
|
||
Run | ||
|
||
``` | ||
$ make cs | ||
$ make docker | ||
``` | ||
|
||
to automatically fix coding standard violations. | ||
to build, tag, and run the Docker image locally. | ||
|
||
## Static Code Analysis | ||
|
||
We are using [`phpstan/phpstan`](https://github.com/phpstan/phpstan) to statically analyze the code. | ||
|
||
Run | ||
|
||
``` | ||
$ make stan | ||
``` | ||
|
||
to run a static code analysis. | ||
|
||
## Tests | ||
|
||
We are using [`phpunit/phpunit`](https://github.com/sebastianbergmann/phpunit) to drive the development. | ||
|
||
Run | ||
|
||
``` | ||
$ make test | ||
``` | ||
|
||
to run all the tests. | ||
|
||
## Mutation Testing | ||
|
||
We are using [`infection/infection`](https://github.com/infection/infection) to ensure a minimum quality of the tests. | ||
|
||
Enable `xdebug` and run | ||
|
||
``` | ||
$ make infection | ||
``` | ||
|
||
to run mutation tests. | ||
|
||
## Benchmarks | ||
|
||
We are using [`phpbench/phpbench`](http://github.com/phpbench/phpbench) to benchmark performance and memory consumption. | ||
## Extra lazy? | ||
|
||
Run | ||
|
||
``` | ||
$ make bench | ||
$ make | ||
``` | ||
|
||
to run all the benchmarks. | ||
to build, tag, and run the Docker image locally. | ||
|
||
## Extra lazy? | ||
|
||
Run | ||
:bulb: Run | ||
|
||
``` | ||
$ make | ||
$ make help | ||
``` | ||
|
||
to enforce coding standards, perform a static code analysis, run tests, and run benchmarks! | ||
to display a list of available targets with corresponding descriptions. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
custom: https://www.buymeacoffee.com/localheinz | ||
github: localheinz | ||
patreon: localheinz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# https://github.com/probot/settings | ||
|
||
branches: | ||
- name: master | ||
protection: | ||
enforce_admins: false | ||
required_pull_request_reviews: | ||
dismiss_stale_reviews: true | ||
require_code_owner_reviews: true | ||
required_approving_review_count: 1 | ||
required_status_checks: | ||
contexts: | ||
- "Docker" | ||
strict: false | ||
restrictions: null | ||
|
||
labels: | ||
- name: bug | ||
color: ee0701 | ||
|
||
- name: enhancement | ||
color: 0e8a16 | ||
|
||
- name: stale | ||
color: eeeeee | ||
|
||
repository: | ||
allow_merge_commit: true | ||
allow_rebase_merge: false | ||
allow_squash_merge: false | ||
default_branch: master | ||
description: ":octocat: + :musical_note: Provides a GitHub action for running localheinz/composer-normalize." | ||
has_downloads: true | ||
has_issues: true | ||
has_pages: false | ||
has_projects: false | ||
has_wiki: false | ||
name: composer-normalize-action | ||
private: false |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions | ||
|
||
on: | ||
- push | ||
|
||
name: "Continuous Deployment" | ||
|
||
jobs: | ||
deploy: | ||
name: "Deploy" | ||
|
||
runs-on: ubuntu-latest | ||
|
||
needs: | ||
- build | ||
|
||
steps: | ||
- name: "Checkout" | ||
if: "'refs/heads/master' == github.ref || startsWith('refs/tags/', github.ref)" | ||
uses: actions/checkout@master | ||
|
||
- name: "Build and tag Docker image" | ||
if: "'refs/heads/master' == github.ref || startsWith('refs/tags/', github.ref)" | ||
run: $(which docker) build --tag localheinz/composer-normalize-action ${GITHUB_WORKSPACE} | ||
|
||
- name: "Docker Login" | ||
if: "'refs/heads/master' == github.ref || startsWith('refs/tags/', github.ref)" | ||
run: echo ${{ secrets.DOCKER_PASSWORD }} | $(which docker) login --password-stdin --username ${{ secrets.DOCKER_USERNAME }}" | ||
|
||
- name: "Push Docker image" | ||
if: "'refs/heads/master' == github.ref || startsWith('refs/tags/', github.ref)" | ||
run: $(which docker) push localheinz/composer-normalize-action:$(bash ./.github/workflows/tag-name.sh ${GITHUB_REF}) | ||
|
||
- name: "Docker Logout" | ||
if: "'refs/heads/master' == github.ref || startsWith('refs/tags/', github.ref)" | ||
run: $(which docker) logout | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions | ||
|
||
on: | ||
- pull_request | ||
- push | ||
|
||
name: "Continuous Integration" | ||
|
||
jobs: | ||
build: | ||
name: "Build" | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: "Checkout" | ||
uses: actions/checkout@master | ||
|
||
- name: "Build and tag Docker image" | ||
run: $(which docker) build --tag localheinz/composer-normalize-action ${GITHUB_WORKSPACE} | ||
|
||
- name: "Run Docker image" | ||
run: $(which docker) run --interactive --rm --workdir=/normalizer --volume ${GITHUB_WORKSPACE}/.build:/normalizer localheinz/composer-normalize-action:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# https://github.com/actions/stale | ||
|
||
name: "Close stale issues and pull requests" | ||
on: | ||
schedule: | ||
- cron: "0 * * * *" | ||
|
||
jobs: | ||
stale: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/stale@v1 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
days-before-stale: 60 | ||
days-before-close: 5 | ||
stale-issue-label: 'stale' | ||
stale-issue-message: > | ||
This issue has been automatically marked as stale because it has not had | ||
recent activity. It will be closed if no further activity occurs. Thank you | ||
for your contributions. | ||
stale-pr-message: > | ||
This PR has been automatically marked as stale because it has not had | ||
recent activity. It will be closed if no further activity occurs. Thank you | ||
for your contributions. | ||
stale-pr-label: 'stale' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env bash | ||
|
||
GITHUB_REF=$1 | ||
|
||
if [[ -n $GITHUB_REF && $GITHUB_REF == "refs/heads/master" ]]; then | ||
echo 'latest'; | ||
|
||
exit 0 | ||
fi | ||
|
||
if [[ -n $GITHUB_REF && $GITHUB_REF == refs/tags/* ]]; then | ||
echo "${GITHUB_REF#refs/tags/}"; | ||
|
||
exit 0 | ||
fi | ||
|
||
echo "Unable to determine tag name" | ||
|
||
exit 1; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
.PHONY: docker it | ||
.PHONY: docker help it | ||
|
||
it: docker | ||
it: docker ## Runs the docker target | ||
|
||
docker: | ||
docker: ## Builds, tags, and runs the Docker image | ||
docker build --tag localheinz/composer-normalize-action . | ||
docker run --interactive --rm --tty --workdir=/normalizer --volume ${PWD}/.build:/normalizer localheinz/composer-normalize-action:latest | ||
|
||
help: ## Displays this list of targets with descriptions | ||
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[32m%-30s\033[0m %s\n", $$1, $$2}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters