Skip to content

Commit

Permalink
add check imports to github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
imanghafoori1 committed Dec 11, 2023
1 parent f0c2aeb commit d6b08df
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 1 deletion.
36 changes: 36 additions & 0 deletions .github/workflows/imports.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -35,6 +36,7 @@
},
"scripts": {
"test": "vendor/bin/phpunit",
"imports": "vendor/bin/check_imports",
"test-coverage": "vendor/bin/phpunit --coverage-html coverage"

},
Expand Down

0 comments on commit d6b08df

Please sign in to comment.