Skip to content

Commit 5aa9ca1

Browse files
committed
Only run our PHPStan workflow if PHP files have changed. Also ensure we cache composer dependencies to make things faster
1 parent 26e2a30 commit 5aa9ca1

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

.github/workflows/phpstan.yml

+17-1
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,15 @@ on:
55
branches:
66
- develop
77
- trunk
8+
paths:
9+
- "**.php"
810
pull_request:
911
branches:
1012
- develop
13+
paths:
14+
- "**.php"
1115

1216
jobs:
13-
1417
phpstan:
1518
name: PHPStan
1619
runs-on: ubuntu-latest
@@ -26,6 +29,19 @@ jobs:
2629
coverage: none
2730
tools: composer:v2
2831

32+
- name: Get composer cache directory
33+
id: composer-cache
34+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
35+
36+
- name: Cache dependencies
37+
id: cache-composer
38+
uses: actions/cache@v4
39+
env:
40+
cache-name: cache-composer
41+
with:
42+
path: ${{ steps.composer-cache.outputs.dir }}
43+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/composer.lock') }}
44+
2945
- name: Install dependencies
3046
run: composer install
3147

0 commit comments

Comments
 (0)