diff --git a/.github/workflows/imports.yml b/.github/workflows/imports.yml new file mode 100644 index 0000000..3184401 --- /dev/null +++ b/.github/workflows/imports.yml @@ -0,0 +1,36 @@ +name: Check Imports + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +permissions: + contents: read + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Validate composer.json and composer.lock + run: composer validate --strict + + - 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: composer run-script imports diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c7c030d..e50ee9e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -18,7 +18,7 @@ jobs: strategy: fail-fast: true matrix: - php: [7.2, 7.3, 7.4, 8.0, 8.1, 8.2] + php: [7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3] laravel: [^6.0, ^7.0, ^8.0, ^9.0, ^10.0] exclude: - php: 7.2 diff --git a/composer.json b/composer.json index a6f42c9..503b5fe 100644 --- a/composer.json +++ b/composer.json @@ -21,6 +21,7 @@ }, "require-dev": { "phpunit/phpunit": "^7.5.20|^8.5.28|^9.5", + "imanghafoori/php-imports-analyzer": "^1.0.2", "symfony/var-dumper" : "3.*|4.*|5.*" }, "autoload": { @@ -35,6 +36,7 @@ }, "scripts": { "test": "vendor/bin/phpunit", + "imports": "vendor/bin/check_imports", "test-coverage": "vendor/bin/phpunit --coverage-html coverage" },