Skip to content

Commit 87f54bb

Browse files
committed
GHA: Only do a single install step
1 parent 0a685dd commit 87f54bb

4 files changed

Lines changed: 14 additions & 10 deletions

File tree

.github/actions/kint-setup/action.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,20 @@ inputs:
88
php-ini-values:
99
required: false
1010
default: ''
11+
npm-version:
12+
required: false
13+
default: null
1114
runs:
1215
using: composite
1316
steps:
1417
- uses: actions/setup-node@v4
18+
if: inputs.npm-version
1519
with:
16-
node-version: latest
20+
node-version: ${{ inputs.npm-version }}
1721
cache: npm
22+
- run: npm ci
23+
shell: bash
24+
if: inputs.npm-version
1825
- uses: shivammathur/setup-php@v2
1926
with:
2027
php-version: ${{ inputs.php-version }}
@@ -29,12 +36,10 @@ runs:
2936
key: ${{ runner.os }}-${{ inputs.php-version < 8.1 }}-${{ hashFiles('./composer.lock') }}
3037
# On old versions we only run tests so strip everything else out
3138
- run: |
32-
composer remove --dev $(composer show --no-interaction --locked --name-only --direct)
39+
composer remove --dev --no-install $(composer show --no-interaction --locked --name-only --direct)
3340
composer config platform.php 7.4
34-
composer require --dev phpunit/phpunit ^9
41+
composer require --dev --no-install phpunit/phpunit ^9
3542
shell: bash
3643
if: inputs.php-version < 8.1
37-
# On new versions just composer install
3844
- run: composer install
3945
shell: bash
40-
if: inputs.php-version >= 8.1

.github/workflows/tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ jobs:
1010
name: Kint setup
1111
with:
1212
php-version: 8.4
13+
npm-version: latest
1314
- run: |
1415
composer format
1516
git status
@@ -26,6 +27,7 @@ jobs:
2627
with:
2728
php-version: 8.4
2829
php-ini-values: 'phar.readonly=Off'
30+
npm-version: latest
2931
- run: |
3032
composer clean
3133
composer build
@@ -40,6 +42,7 @@ jobs:
4042
name: Kint setup
4143
with:
4244
php-version: 8.4
45+
npm-version: latest
4346
- run: composer analyze
4447
test-basic:
4548
name: 'Basic test ${{ matrix.php-coverage }}'

CONTRIBUTING.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,9 @@ When expanding Kint, keep in mind its main priorities:
1616
### Development instructions
1717

1818
```sh
19-
composer install # Install dependencies
19+
composer install && npm ci # Install dependencies
2020
composer format # Format code style
2121
composer analyze # Static analysis
2222
./vendor/bin/phpunit tests # Run unit tests
2323
composer build # Build JS/CSS resources, and the final phar file
2424
```
25-
26-
Note: Full format and build depends on `npm` being in your `$PATH`.

composer.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@
4242
}
4343
},
4444
"scripts": {
45-
"post-update-cmd": "npm ci",
46-
"post-install-cmd": "@post-update-cmd",
4745
"clean": [
4846
"rm -rf resources/compiled/",
4947
"rm -rf build/"

0 commit comments

Comments
 (0)