diff --git a/.github/workflows/check_imports.yml b/.github/workflows/check_imports.yml new file mode 100644 index 0000000..cbbef7e --- /dev/null +++ b/.github/workflows/check_imports.yml @@ -0,0 +1,33 @@ +name: Check Imports + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +permissions: + contents: read + +jobs: + check_imports: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - 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: Check Imports + run: ./vendor/bin/check_imports diff --git a/README.md b/README.md index e53d41d..13a55d0 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ [![Tests](https://github.com/laracraft-tech/laravel-date-scopes/actions/workflows/run-tests.yml/badge.svg?branch=main)](https://github.com/laracraft-tech/laravel-date-scopes/actions/workflows/run-tests.yml) [![License](https://img.shields.io/packagist/l/laracraft-tech/laravel-date-scopes.svg?style=flat-square)](https://packagist.org/packages/laracraft-tech/laravel-date-scopes) [![Total Downloads](https://img.shields.io/packagist/dt/laracraft-tech/laravel-date-scopes.svg?style=flat-square)](https://packagist.org/packages/laracraft-tech/laravel-date-scopes) +[![Imports](https://github.com/laracraft-tech/laravel-date-scopes/actions/workflows/check_imports.yml/badge.svg?branch=master)](https://github.com/laracraft-tech/laravel-date-scopes/actions/workflows/check_imports.yml) This package provides a big range of useful **date scopes** for your Laravel Eloquent models! diff --git a/composer.json b/composer.json index 109cabb..d77accd 100644 --- a/composer.json +++ b/composer.json @@ -24,6 +24,7 @@ "spatie/laravel-package-tools": "^1.13.0" }, "require-dev": { + "imanghafoori/php-imports-analyzer": "^1.0.6", "nunomaduro/larastan": "^2.0.1", "orchestra/testbench": "^7.0 || ^8.0", "pestphp/pest": "^1.22 || ^2.0",