Skip to content

Commit

Permalink
Adapt the project setup (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
spawnia authored Aug 11, 2021
1 parent d55b409 commit 0046d8a
Show file tree
Hide file tree
Showing 32 changed files with 334 additions and 234 deletions.
6 changes: 6 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
coverage:
status:
project:
default:
only_pulls: true
comment: false
9 changes: 6 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
; This file is for unifying the coding style for different editors and IDEs.
; More information at http://editorconfig.org
; More information at https://editorconfig.org

root = true

[*]
charset = utf-8
indent_size = 4
indent_style = space
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.yml]
indent_size = 2
14 changes: 14 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
* text=auto

/.github export-ignore
/tests export-ignore
/.codecov.yml export-ignore
/.editorconfig export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.styleci.yml export-ignore
/CHANGELOG.md export-ignore
/CONDUCT.md export-ignore
/CONTRIBUTING.md export-ignore
/phpunit.xml export-ignore
/UPGRADE.md export-ignore
14 changes: 14 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
- [ ] Added or updated tests
- [ ] Documented user facing changes
- [ ] Updated CHANGELOG.md

<!-- Link to related issues this PR resolves, e.g. "Resolves #236"-->

**Changes**

<!-- Detail the changes in behaviour this PR introduces. -->

**Breaking changes**

<!-- Are existing use cases affected and require changes when upgrading?
If so, describe the necessary changes in UPGRADE.md. -->
32 changes: 32 additions & 0 deletions .github/workflows/autoformat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: "Autoformat"
on:
push:

jobs:
composer-normalize:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}

- uses: docker://ergebnis/composer-normalize-action:0.8.0

- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Normalize composer.json

prettier:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}

- uses: creyD/[email protected]
with:
prettier_options: --write --tab-width=2 *.md
branch: ${{ github.head_ref }}
commit_message: Prettify
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
101 changes: 101 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: "Validate"
on:
pull_request:
push:
branches:
- master

env:
REQUIRED_PHP_EXTENSIONS: mbstring, mysqli, pdo_sqlite

jobs:
tests:
runs-on: ubuntu-20.04

strategy:
matrix:
php-version:
- 7.1
- 7.2
- 7.3
- 7.4
- 8.0
laravel-version:
- 5.6.*
- 5.7.*
- 5.8.*
- ^6
- ^7
- ^8
exclude:
- php-version: 7.1
laravel-version: ^6
- php-version: 7.1
laravel-version: ^7
- php-version: 7.1
laravel-version: ^8
- php-version: 7.2
laravel-version: ^8
- php-version: 8.0
laravel-version: 5.6.*
- php-version: 8.0
laravel-version: 5.7.*
- php-version: 8.0
laravel-version: 5.8.*
- php-version: 8.0
laravel-version: ^6
- php-version: 8.0
laravel-version: ^7

steps:
- uses: actions/checkout@v2

- uses: shivammathur/setup-php@v2
with:
extensions: ${{ env.REQUIRED_PHP_EXTENSIONS }}
php-version: ${{ matrix.php-version }}

- name: "Cache composer dependencies"
uses: actions/cache@v1
with:
path: ~/.composer/cache
key: php-${{ matrix.php-version }}-composer-${{ matrix.laravel-version }}
restore-keys: php-${{ matrix.php-version }}-composer-${{ matrix.laravel-version }}-

- run: composer require illuminate/support:${{ matrix.laravel-version }} --no-interaction --prefer-dist --no-progress

- run: vendor/bin/phpunit --colors=always --verbose

coverage:
runs-on: ubuntu-20.04

strategy:
matrix:
php-version:
- 8.0
laravel-version:
- ^8

steps:
- uses: actions/checkout@v2

- uses: shivammathur/setup-php@v2
with:
coverage: pcov
extensions: ${{ env.REQUIRED_PHP_EXTENSIONS }}
php-version: ${{ matrix.php-version }}

- name: "Cache composer dependencies"
uses: actions/cache@v1
with:
path: ~/.composer/cache
key: php-${{ matrix.php-version }}-composer-${{ matrix.laravel-version }}
restore-keys: php-${{ matrix.php-version }}-composer-${{ matrix.laravel-version }}-

- run: composer require illuminate/support:${{ matrix.laravel-version }} --no-interaction --prefer-dist --no-progress

- run: vendor/bin/phpunit --coverage-clover=coverage.xml

- run: bash <(curl -s https://codecov.io/bash)
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/vendor
composer.phar
vendor
composer.lock
.DS_Store
.idea/
.php_cs.cache
31 changes: 0 additions & 31 deletions .scrutinizer.yml

This file was deleted.

4 changes: 3 additions & 1 deletion .styleci.yml
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
preset: psr2
preset: laravel
enabled:
- no_superfluous_phpdoc_tags
15 changes: 0 additions & 15 deletions .travis.yml

This file was deleted.

17 changes: 14 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,42 @@
# Changelog

All Notable changes to `Laravel Comment` will be documented in this file.
All notable changes to this project will be documented in this file.

Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) principles.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.1.0] - 2021-08-10

### Added

- Support PHP 8

## [1.0.0] - 2018-11-21

### Added
- Initial Release.

- `Commentable` has been reimplemented as a contract.
- `HasComments` trait has been implemented.
- `comment.php` configuration file has been created.

## [0.3.0] - 2017-01-31

### Added

- Laravel 5.4 Support.

## [0.2.1] - 2016-10-20

### Added

- User model isAdmin calculation.

## [0.2.0] - 2016-10-18

### Added

- Laravel 5.3 Support.

## [0.1.0] - 2016-06-11

- Initial Release
14 changes: 7 additions & 7 deletions CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ We are committed to making participation in this project a harassment-free exper

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery
* Personal attacks
* Trolling or insulting/derogatory comments
* Public or private harassment
* Publishing other's private information, such as physical or electronic addresses, without explicit permission
* Other unethical or unprofessional conduct.
- The use of sexualized language or imagery
- Personal attacks
- Trolling or insulting/derogatory comments
- Public or private harassment
- Publishing other's private information, such as physical or electronic addresses, without explicit permission
- Other unethical or unprofessional conduct.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. By adopting this Code of Conduct, project maintainers commit themselves to fairly and consistently applying these principles to every aspect of managing this project. Project maintainers who do not follow or enforce the Code of Conduct may be permanently removed from the project team.

This code of conduct applies both within project spaces and in public spaces when an individual is representing the project or its community in a direct capacity. Personal views, beliefs and values of individuals do not necessarily reflect those of the organisation or affiliated individuals and organisations.

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.

This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.2.0, available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/)
This Code of Conduct is adapted from the [Contributor Covenant](https://contributor-covenant.org), version 1.2.0, available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/)
21 changes: 8 additions & 13 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,26 @@

Contributions are **welcome** and will be fully **credited**.

We accept contributions via Pull Requests on [Github](https://github.com/actuallymab/laravel-comment).

We accept contributions via Pull Requests on [Github](https://github.com/mll-lab/laravel-comment).

## Pull Requests

- **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** - The easiest way to apply the conventions is to install [PHP Code Sniffer](http://pear.php.net/package/PHP_CodeSniffer).

- **Add tests!** - Your patch won't be accepted if it doesn't have tests.
- **Add tests!** - Your patch won't be accepted if it does not have tests.

- **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date.

- **Consider our release cycle** - We try to follow [SemVer v2.0.0](http://semver.org/). Randomly breaking public APIs is not an option.
- **Consider our release cycle** - We follow [Semantic Versioning 2.0.0](https://semver.org). Randomly breaking public APIs is not an option.

- **Create feature branches** - Don't ask us to pull from your master branch.

- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests.

- **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash them](http://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting.

- **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash them](https://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting.

## Running Tests
## Setup

``` bash
$ composer test
```
composer update

## Run Tests

**Happy coding**!
vendor/bin/phpunit
Loading

0 comments on commit 0046d8a

Please sign in to comment.