diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 16d84de6..fb8a8af8 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -3,28 +3,41 @@ name: Check # Run this workflow every time a new commit pushed to your repository on: push: - paths-ignore: - - '.github/**/*' - - '**/*.md' - - 'public/build/*.js' - - 'public/build/**/*.js' - - 'docker/**/*' - - 'resources/scripts/**/*' tags-ignore: - "*" branches-ignore: - 'translations' pull_request: - paths-ignore: - - '**/*.md' - - 'public/build/*.js' - - 'public/build/**/*.js' branches-ignore: - 'translations' # Allow manually triggering the workflow. workflow_dispatch: jobs: + changes: + name: 🔍 Detect changes + runs-on: ubuntu-latest + outputs: + php: ${{ steps.filter.outputs.php }} + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Check for file changes + uses: dorny/paths-filter@v3 + id: filter + with: + filters: | + php: + - 'app/**' + - 'config/**' + - 'database/**' + - 'routes/**' + - 'tests/**' + - 'composer.json' + - 'composer.lock' + - 'phpunit.xml' + kill_previous: name: 0️⃣ Kill previous runs runs-on: ubuntu-latest @@ -41,6 +54,8 @@ jobs: runs-on: ubuntu-latest needs: - kill_previous + - changes + if: needs.changes.outputs.php == 'true' steps: - name: Set up PHP uses: shivammathur/setup-php@v2 @@ -60,6 +75,8 @@ jobs: name: 2️⃣ PHP ${{ matrix.php-version }} Tests needs: - php_syntax_errors + - changes + if: needs.changes.outputs.php == 'true' runs-on: ubuntu-latest strategy: matrix: