@@ -25,19 +25,31 @@ jobs:
2525 - uses : actions/checkout@v6
2626 - uses : actions/cache@v4
2727 with :
28- path : vendor
28+ path : |
29+ vendor
30+ .composer-cache
2931 key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
3032 restore-keys : |
3133 ${{ runner.os }}-composer-
32- - uses : actions/cache@v4
34+ - id : webpack-cache
35+ uses : actions/cache@v4
36+ with :
37+ path : public/build
38+ key : ${{ runner.os }}-webpack-${{ hashFiles('assets/**', 'package-lock.json', 'webpack.config.js') }}
39+ - run : composer install --no-scripts --no-progress
40+ env :
41+ COMPOSER_CACHE_DIR : .composer-cache
42+ - if : steps.webpack-cache.outputs.cache-hit != 'true'
43+ uses : actions/cache@v4
3344 with :
3445 path : node_modules
3546 key : ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
3647 restore-keys : |
3748 ${{ runner.os }}-npm-
38- - run : composer install --no-scripts --no-progress
39- - run : npm install
40- - run : npm run dev
49+ - if : steps.webpack-cache.outputs.cache-hit != 'true'
50+ run : npm install
51+ - if : steps.webpack-cache.outputs.cache-hit != 'true'
52+ run : npm run dev
4153 - run : vendor/bin/phpunit --testsuite "Project Test Suite"
4254
4355 panther-tests :
@@ -57,23 +69,35 @@ jobs:
5769 - uses : actions/checkout@v6
5870 - uses : actions/cache@v4
5971 with :
60- path : vendor
72+ path : |
73+ vendor
74+ .composer-cache
6175 key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
6276 restore-keys : |
6377 ${{ runner.os }}-composer-
64- - uses : actions/cache@v4
78+ - id : webpack-cache
79+ uses : actions/cache@v4
6580 with :
66- path : node_modules
67- key : ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
68- restore-keys : |
69- ${{ runner.os }}-npm-
81+ path : public/build
82+ key : ${{ runner.os }}-webpack-${{ hashFiles('assets/**', 'package-lock.json', 'webpack.config.js') }}
7083 - uses : shivammathur/setup-php@v2
7184 with :
7285 php-version : ' 8.5'
7386 extensions : pdo_pgsql, intl, redis, imagick, uuid
7487 - run : composer install --no-scripts --no-progress
75- - run : npm install
76- - run : npm run dev
88+ env :
89+ COMPOSER_CACHE_DIR : .composer-cache
90+ - if : steps.webpack-cache.outputs.cache-hit != 'true'
91+ uses : actions/cache@v4
92+ with :
93+ path : node_modules
94+ key : ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
95+ restore-keys : |
96+ ${{ runner.os }}-npm-
97+ - if : steps.webpack-cache.outputs.cache-hit != 'true'
98+ run : npm install
99+ - if : steps.webpack-cache.outputs.cache-hit != 'true'
100+ run : npm run dev
77101 - run : bin/console doctrine:migrations:migrate --no-interaction --allow-no-migration
78102 - name : Run Panther tests
79103 run : vendor/bin/phpunit --testsuite "Panther Test Suite"
@@ -86,11 +110,21 @@ jobs:
86110 - uses : actions/checkout@v6
87111 - uses : actions/cache@v4
88112 with :
89- path : vendor
113+ path : |
114+ vendor
115+ .composer-cache
90116 key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
91117 restore-keys : |
92118 ${{ runner.os }}-composer-
119+ - uses : actions/cache@v4
120+ with :
121+ path : var/phpstan
122+ key : ${{ runner.os }}-phpstan-${{ hashFiles('src/**/*.php', 'tests/**/*.php', 'config/**/*.php', 'phpstan.neon') }}
123+ restore-keys : |
124+ ${{ runner.os }}-phpstan-
93125 - run : composer install --no-scripts --no-progress
126+ env :
127+ COMPOSER_CACHE_DIR : .composer-cache
94128 - run : bin/console cache:warmup --env=dev
95129 - run : composer run-script phpstan
96130
@@ -102,11 +136,15 @@ jobs:
102136 - uses : actions/checkout@v6
103137 - uses : actions/cache@v4
104138 with :
105- path : vendor
139+ path : |
140+ vendor
141+ .composer-cache
106142 key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
107143 restore-keys : |
108144 ${{ runner.os }}-composer-
109145 - run : composer install --no-scripts --no-progress
146+ env :
147+ COMPOSER_CACHE_DIR : .composer-cache
110148 - run : composer run cs
111149
112150
@@ -126,12 +164,16 @@ jobs:
126164 - uses : actions/checkout@v6
127165 - uses : actions/cache@v4
128166 with :
129- path : vendor
167+ path : |
168+ vendor
169+ .composer-cache
130170 key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
131171 restore-keys : |
132172 ${{ runner.os }}-composer-
133173
134174 - run : composer install --no-scripts --no-progress
175+ env :
176+ COMPOSER_CACHE_DIR : .composer-cache
135177 - run : bin/console doctrine:migrations:migrate --no-interaction --allow-no-migration
136178 - run : bin/console doctrine:schema:update --dump-sql
137179 - run : bin/console doctrine:schema:validate
0 commit comments