Skip to content

Commit

Permalink
feat: update dependencies, add linting, fix codebase, cleanup (#11)
Browse files Browse the repository at this point in the history
* chore(deps): update dependencies

* feat(tests): add matrix testing, problem matcher

* feat(lint): add php-cs-fixer, fix codebase
  • Loading branch information
ivuorinen authored Nov 8, 2024
1 parent dfd2dc0 commit 61ac971
Show file tree
Hide file tree
Showing 15 changed files with 118 additions and 6,950 deletions.
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# EditorConfig is awesome: https://editorconfig.org

# top-most EditorConfig file
root = true

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

[*.yml]
indent_size = 2

41 changes: 33 additions & 8 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,40 @@ jobs:
build-test:
runs-on: ubuntu-latest

strategy:
matrix:
php_version:
- 7.4
- 8.0
- 8.1
- 8.2
- 8.3
- latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php_version }}
tools: composer, phpunit

- uses: php-actions/composer@v5
- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: PHPUnit Tests
uses: php-actions/phpunit@v2
- name: Cache Composer dependencies
uses: actions/cache@v4
with:
php_extensions: xdebug mbstring
bootstrap: vendor/autoload.php
configuration: phpunit.xml
args: --coverage-text
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-${{ matrix.php_version }}-${{ hashFiles('**/composer.json') }}

- name: Install Dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist

- name: Configure matchers
uses: mheap/phpunit-matcher-action@v1

- name: Run tests
run: composer test-ci

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
vendor
vendor
composer.lock
15 changes: 15 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

$finder = (new PhpCsFixer\Finder())
->in(__DIR__);

return (new PhpCsFixer\Config())
->setRules([
'@PhpCsFixer' => true,
'@PHP74Migration' => true,
'@PSR12' => true,
'strict_param' => true,
'array_syntax' => ['syntax' => 'short'],
])
->setFinder($finder)
;
21 changes: 0 additions & 21 deletions .travis.yml

This file was deleted.

26 changes: 8 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@

[![Latest Version on Packagist][ico-version]][link-packagist]
[![Software License][ico-license]](LICENSE.md)
[![Build Status][ico-travis]][link-travis]
[![Coverage Status][ico-scrutinizer]][link-scrutinizer]
[![Quality Score][ico-code-quality]][link-code-quality]
[![Total Downloads][ico-downloads]][link-downloads]

This is a collection of Laravel Artisan commands created to help everyone
Expand All @@ -16,7 +13,7 @@ This package requires PHP 7.3 or later. The `composer.lock` file has been genera

### Step 1: Install Through Composer

``` bash
```bash
$ composer require superhelio/commands --dev
```

Expand All @@ -35,20 +32,20 @@ public function register()

## Usage

- *superhelio:gozer*
- Force delete database tables that have your table prefix
- `php artisan superhelio:gozer`
- *superhelio:reload*
- Reset database, migrate and seed
- `php artisan superhelio:reload`
- _superhelio:gozer_
- Force delete database tables that have your table prefix
- `php artisan superhelio:gozer`
- _superhelio:reload_
- Reset database, migrate and seed
- `php artisan superhelio:reload`

## Change log

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

## Testing

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

Expand All @@ -67,15 +64,8 @@ The MIT License (MIT). Please see [License File](LICENSE.md) for more informatio

[ico-version]: https://img.shields.io/packagist/v/superhelio/commands.svg?style=flat-square
[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square
[ico-travis]: https://img.shields.io/travis/superhelio/commands/master.svg?style=flat-square
[ico-scrutinizer]: https://img.shields.io/scrutinizer/coverage/g/superhelio/commands.svg?style=flat-square
[ico-code-quality]: https://img.shields.io/scrutinizer/g/superhelio/commands.svg?style=flat-square
[ico-downloads]: https://img.shields.io/packagist/dt/superhelio/commands.svg?style=flat-square

[link-packagist]: https://packagist.org/packages/superhelio/commands
[link-travis]: https://travis-ci.org/superhelio/commands
[link-scrutinizer]: https://scrutinizer-ci.com/g/superhelio/commands/code-structure
[link-code-quality]: https://scrutinizer-ci.com/g/superhelio/commands
[link-downloads]: https://packagist.org/packages/superhelio/commands
[link-author]: https://github.com/superhelio
[link-contributors]: https://github.com/superhelio/commands/graphs/contributors
Expand Down
15 changes: 9 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@
}
],
"require": {
"php" : ">=7.3",
"illuminate/support": "^5.3|^6.0|^7.0|^8.0",
"doctrine/dbal": "^2.5|^2.6"
"php": "^7.4|^8",
"illuminate/support": "^5.3|^6|^7|^8|^9|^10|^11",
"doctrine/dbal": "^2.5|^2.6|^3"
},
"require-dev": {
"roave/security-advisories": "dev-master",
"phpunit/phpunit" : "^8.0",
"orchestra/testbench": "^3.3|^4|^5|^6"
"phpunit/phpunit": "^8.0",
"orchestra/testbench": "^3.3|^4|^5|^6|^7|^8",
"friendsofphp/php-cs-fixer": "^3.9"
},
"autoload": {
"psr-4": {
Expand All @@ -37,7 +38,9 @@
}
},
"scripts": {
"test": "phpunit"
"lint": "PHP_CS_FIXER_IGNORE_ENV=1 php-cs-fixer fix --diff --allow-risky=yes",
"test": "phpunit",
"test-ci": "phpunit --teamcity"
},
"extra": {
"branch-alias": {
Expand Down
Loading

0 comments on commit 61ac971

Please sign in to comment.