Skip to content

Commit

Permalink
chore: Sync changes from the template
Browse files Browse the repository at this point in the history
  • Loading branch information
oprypkhantc authored and package-sync[bot] committed Apr 25, 2024
1 parent bf8936e commit 8c1a8c6
Show file tree
Hide file tree
Showing 10 changed files with 190 additions and 169 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false
trim_trailing_whitespace = false
28 changes: 14 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Release

on:
workflow_run:
workflows: ["Tests"]
workflows: ['Tests']
types:
- completed
branches:
Expand All @@ -18,17 +18,17 @@ jobs:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Create a release
uses: cycjimmy/semantic-release-action@v3
with:
extra_plugins: |
@semantic-release/changelog
@semantic-release/git
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Create a release
uses: cycjimmy/semantic-release-action@v3
with:
extra_plugins: |
@semantic-release/changelog
@semantic-release/git
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 0 additions & 2 deletions .github/workflows/template-sync.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: Template sync

on:
push:
branches: ['sync']
workflow_dispatch:
schedule:
- cron: '*/5 * * * *'
Expand Down
187 changes: 100 additions & 87 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,105 +9,118 @@ jobs:
strategy:
fail-fast: true
matrix:
php: [ 8.1, 8.2 ]
test-bench: [ ^7.0, ^8.0 ]
php: [8.2]
test-bench: [^8.0]

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer:v2
coverage: none

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

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: |
composer require "orchestra/testbench=${{ matrix.test-bench }}" --dev --no-update
composer install --prefer-dist --no-progress
- name: Execute phpunit
run: composer test -- --colors=always
- name: Checkout code
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer:v2
coverage: none

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

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: |
composer require "orchestra/testbench=${{ matrix.test-bench }}" --dev --no-update
composer install --prefer-dist --no-progress
- name: Execute phpunit
run: composer test -- --colors=always

php-cs-fixer:
name: php-cs-fixer
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
extensions: dom, curl, libxml, mbstring, zip
tools: composer:v2
coverage: none

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Execute php-cs-fixer
run: composer cs-fix -- --dry-run --diff --using-cache=no
- name: Checkout code
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
extensions: dom, curl, libxml, mbstring, zip
tools: composer:v2
coverage: none

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Execute php-cs-fixer
run: composer cs-fix -- --dry-run --diff --using-cache=no

prettier:
name: Prettier
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Run prettier
uses: actionsx/prettier@v2
with:
args: --check .

phpstan:
name: PHPStan on PHP v${{ matrix.php }} & TestBench ${{ matrix.test-bench }}
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
php: [ 8.1, 8.2 ]
test-bench: [ ^7.0, ^8.0 ]
php: [8.2]
test-bench: [^8.0]
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer:v2
coverage: none

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

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: |
composer require "orchestra/testbench=${{ matrix.test-bench }}" --dev --no-update
composer install --prefer-dist --no-progress
- name: Execute phpstan
run: composer phpstan
- name: Checkout code
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer:v2
coverage: none

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

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: |
composer require "orchestra/testbench=${{ matrix.test-bench }}" --dev --no-update
composer install --prefer-dist --no-progress
- name: Execute phpstan
run: composer phpstan
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
!.idea/fileTemplates

# Dependencies
/vendor/
/vendor
/composer.lock

# Build/coverage
Expand All @@ -16,7 +16,7 @@
**/.phpunit.result.cache

# Temporary
tmp/
/tmp

# Misc
.DS_Store
Expand Down
7 changes: 7 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
CHANGELOG.md

/.idea
/build
/coverage
/tmp
/vendor
1 change: 1 addition & 0 deletions .prettierrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
singleQuote: true
10 changes: 6 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# Commands

Here are some of the commands that you'll need:
- install dependencies: `docker run -it --rm -v $PWD:/app -w /app chialab/php-dev:8.2 composer install`
- run tests with phpunit: `docker run -it --rm -v $PWD:/app -w /app chialab/php-dev:8.2 composer test`
- reformat using php-cs-fixer: `docker run -it --rm -v $PWD:/app -w /app chialab/php-dev:8.2 composer cs-fix`
- analyse with phpstan: `docker run -it --rm -v $PWD:/app -w /app chialab/php-dev:8.2 composer phpstan`

- install dependencies: `docker run -it --rm -v $PWD:/app -w /app chialab/php-dev:8.2 composer install`
- run tests with phpunit: `docker run -it --rm -v $PWD:/app -w /app chialab/php-dev:8.2 composer test`
- reformat using php-cs-fixer: `docker run -it --rm -v $PWD:/app -w /app chialab/php-dev:8.2 composer cs-fix`
- reformat the rest with prettier: `docker run -it --rm -v $PWD:/app -w /app tmknom/prettier --write .`
- analyse with phpstan: `docker run -it --rm -v $PWD:/app -w /app chialab/php-dev:8.2 composer phpstan`
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,31 @@ This package is designed for high-load applications and optimizes queries with s

Via Composer

``` bash
```bash
$ composer require tenantcloud/laravel-boolean-softdeletes
```

Add `Webkid\LaravelBooleanSoftdeletes\SoftDeletesBoolean` trait to models with soft deletes.

Then create and run migration to add soft delete boolean field

```php
Schema::table('users', function (Blueprint $table) {
$table->boolean('is_deleted')->default(0)->index();
});
```

If you want to use this package for existing project you can use built-in command

```dotenv
php artisan softdeletes:migrate
```

Also you can change default column name `is_deleted` to any other by setting static property `IS_DELETED`of certain model


Versions compatibility
``` bash

```bash
For Laravel 5 - laravel-boolean-softdeletes 0.1.2
For Laravel 6 - laravel-boolean-softdeletes 1.0.0
For Laravel 7 - laravel-boolean-softdeletes 2.0.0
Expand All @@ -44,7 +46,6 @@ For Laravel 9 - laravel-boolean-softdeletes 4.*
For Laravel 10 - laravel-boolean-softdeletes 5.*
```


## Change log

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
Expand All @@ -59,8 +60,8 @@ If you discover any security related issues, please email kolodiy.ivan.i@gmail.c

## Credits

- [Ivan Kolodiy][link-author]
- [All Contributors][link-contributors]
- [Ivan Kolodiy][link-author]
- [All Contributors][link-contributors]

## License

Expand All @@ -72,7 +73,6 @@ The MIT License (MIT). Please see [License File](LICENSE.md) for more informatio
[ico-scrutinizer]: https://img.shields.io/scrutinizer/coverage/g/tenantcloud/laravel-boolean-softdeletes.svg?style=flat-square
[ico-code-quality]: https://img.shields.io/scrutinizer/g/tenantcloud/laravel-boolean-softdeletes.svg?style=flat-square
[ico-downloads]: https://img.shields.io/packagist/dt/tenantcloud/laravel-boolean-softdeletes.svg?style=flat-square

[link-packagist]: https://packagist.org/packages/tenantcloud/laravel-boolean-softdeletes
[link-travis]: https://travis-ci.org/tenantcloud/laravel-boolean-softdeletes
[link-scrutinizer]: https://scrutinizer-ci.com/g/tenantcloud/laravel-boolean-softdeletes/code-structure
Expand Down
Loading

0 comments on commit 8c1a8c6

Please sign in to comment.