Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: Synchronize project tooling configuration with localheinz/php-library-template #47

Merged
merged 1 commit into from
Sep 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
/.dependabot/ export-ignore
/.github/ export-ignore
/.travis/ export-ignore
/test/ export-ignore
/.editorconfig export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.php_cs export-ignore
/.travis.yml export-ignore
/Makefile export-ignore
/phpstan.neon export-ignore
12 changes: 10 additions & 2 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# 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 a continuous integration system.

For details, see [`.travis.yml`](../.travis.yml).
For details, see [`workflows/continuous-integration.yml`](workflows/continuous-integration.yml).

## Coding Standards

Expand Down Expand Up @@ -49,3 +49,11 @@ $ make
```

to enforce coding standards, perform a static code analysis, and run tests!

:bulb: Run

```
$ make help
```

to display a list of available targets with corresponding descriptions.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
custom: https://www.buymeacoffee.com/localheinz
github: localheinz
patreon: localheinz
6 changes: 4 additions & 2 deletions .github/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ branches:
required_approving_review_count: 1
required_status_checks:
contexts:
- "Travis CI - Branch"
- "Travis CI - Pull Request"
- "Coding Standards"
- "Static Code Analysis"
- "Tests (php7.2)"
- "Tests (php7.3)"
strict: false
restrictions: null

Expand Down
65 changes: 65 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions

on:
- pull_request
- push

name: "Continuous Integration"

jobs:
coding-standards:
name: "Coding Standards"

runs-on: ubuntu-latest

steps:
- name: "Checkout"
uses: actions/checkout@master

- name: "Validate composer.json and composer.lock"
run: php7.2 $(which composer) validate --strict

- name: "Install locked dependencies with composer"
run: php7.2 $(which composer) install --no-interaction --no-progress --no-suggest

- name: "Run localheinz/composer-normalize"
run: php7.2 $(which composer) normalize --dry-run

- name: "Run friendsofphp/php-cs-fixer"
run: php7.2 vendor/bin/php-cs-fixer fix --config=.php_cs --diff --diff-format=udiff --using-cache=no --verbose

static-code-analysis:
name: "Static Code Analysis"

runs-on: ubuntu-latest

steps:
- name: "Checkout"
uses: actions/checkout@master

- name: "Install locked dependencies with composer"
run: php7.2 $(which composer) install --no-interaction --no-progress --no-suggest

- name: "Run phpstan/phpstan"
run: php7.2 vendor/bin/phpstan analyse --configuration=phpstan.neon

tests:
name: "Tests"

runs-on: ubuntu-latest

strategy:
matrix:
php-binary:
- php7.2
- php7.3

steps:
- name: "Checkout"
uses: actions/checkout@master

- name: "Install locked dependencies with composer"
run: ${{ matrix.php-binary }} $(which composer) install --no-interaction --no-progress --no-suggest

- name: "Run unit tests with phpunit/phpunit"
run: ${{ matrix.php-binary }} vendor/bin/phpunit --configuration=test/Unit/phpunit.xml
1 change: 0 additions & 1 deletion .php_cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ $config->getFinder()
'.build',
'.dependabot',
'.github',
'.travis',
])
->name('.php_cs');

Expand Down
87 changes: 0 additions & 87 deletions .travis.yml

This file was deleted.

22 changes: 0 additions & 22 deletions .travis/xdebug.sh

This file was deleted.

17 changes: 10 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
.PHONY: cs it stan test
.PHONY: cs help it stan test

it: cs stan test
it: cs stan test ## Runs the cs, stan, and test targets

cs: vendor
cs: vendor ## Fixes code style issues with php-cs-fixer
mkdir -p .build/php-cs-fixer
vendor/bin/php-cs-fixer fix --config=.php_cs --diff --verbose
vendor/bin/php-cs-fixer fix --config=.php_cs --diff --diff-format=udiff --verbose

stan: vendor
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}'

stan: vendor ## Runs a static analysis with phpstan
mkdir -p .build/phpstan
vendor/bin/phpstan analyse --configuration=phpstan.neon

test: vendor
test: vendor ## Runs auto-review, unit, and integration tests with phpunit
mkdir -p .build/phpunit
vendor/bin/phpunit --configuration=test/Unit/phpunit.xml

vendor: composer.json composer.lock
composer validate --strict
composer install
composer install --no-interaction --no-progress --no-suggest
composer normalize
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# http-method

[![Build Status](https://travis-ci.com/localheinz/http-method.svg?branch=master)](https://travis-ci.com/localheinz/http-method)
[![CI Status](https://github.com/localheinz/http-method/workflows/Continuous%20Integration/badge.svg)](https://github.com/localheinz/http-method/actions)
[![Latest Stable Version](https://poser.pugx.org/localheinz/http-method/v/stable)](https://packagist.org/packages/localheinz/http-method)
[![Total Downloads](https://poser.pugx.org/localheinz/http-method/downloads)](https://packagist.org/packages/localheinz/http-method)

Expand Down