diff --git a/.github/workflows/check_import.yml b/.github/workflows/check_import.yml new file mode 100644 index 0000000..fe11457 --- /dev/null +++ b/.github/workflows/check_import.yml @@ -0,0 +1,33 @@ +name: Check Imports + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +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 634ef09..f0213f6 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ Quality Score [![Build Status](https://scrutinizer-ci.com/g/imanghafoori1/laravel-anypass/badges/build.png?b=master)](https://scrutinizer-ci.com/g/imanghafoori1/laravel-anypass/build-status/master) [![License](https://poser.pugx.org/imanghafoori/laravel-anypass/license)](https://packagist.org/packages/imanghafoori/laravel-anypass) +[![Check Imports](https://github.com/imanghafoori1/laravel-anypass/actions/workflows/check_import.yml/badge.svg?branch=master)](https://github.com/imanghafoori1/laravel-anypass/actions/workflows/check_import.yml) [![StyleCI](https://github.styleci.io/repos/132257244/shield?branch=master)](https://github.styleci.io/repos/132257244) ### Built with :heart: for every "lazy" laravel developer ;) diff --git a/composer.json b/composer.json index 4b919a6..ea25b79 100644 --- a/composer.json +++ b/composer.json @@ -22,6 +22,7 @@ }, "require-dev": { "orchestra/testbench": "^4.0|^5.0|^6.0", + "imanghafoori/php-imports-analyzer": "^1.0.6", "laravel/legacy-factories": "^1.1" }, "autoload-dev": {