Skip to content

Commit

Permalink
Add Node setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Sophist-UK committed Jan 3, 2025
1 parent bf54ef6 commit 56775dc
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 7 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
strategy:
matrix:
php-version: [8.3]
node-version: [current]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
name: Code coverage with PHP ${{ matrix.php-version }} on ${{ matrix.os }}
Expand All @@ -42,7 +43,7 @@ jobs:
with:
php-version: ${{ matrix.php-versions }}
extensions: ${{ env.php-extensions }}
key: vl-${{ matrix.os }}-php${{ matrix.php-version }}-${{ hashFiles('composer.json', 'composer.lock', 'package.json', 'package.lock') }}
key: vl-${{ matrix.os }}-php${{ matrix.php-version }}-node${{ matrix.node-version }}-${{ hashFiles('composer.json', 'composer.lock', 'package.json', 'package.lock') }}

- name: Get Composer cache directory
id: composer-cache
Expand All @@ -61,12 +62,20 @@ jobs:
key: ${{ steps.extcache.outputs.key }}
restore-keys: vl-${{ matrix.os }}-php${{ matrix.php-version }}-

- uses: shivammathur/setup-php@9e72090525849c5e82e596468b86eb55e9cc5401
- name: Setup PHP
uses: shivammathur/setup-php@9e72090525849c5e82e596468b86eb55e9cc5401
with:
php-version: ${{ matrix.php-version }}
extensions: ${{ env.php-extensions }}
coverage: ${{ env.php-coverage }}

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: 'src'

- name: Install Dependencies
run: |
composer self-update && composer install --no-interaction --no-progress --prefer-dist -vv
Expand Down
19 changes: 14 additions & 5 deletions .github/workflows/laravel-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ jobs:
strategy:
matrix:
php-version: [8.2, 8.3, 8.4]
node-version: [current]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
name: PHPUnit tests with PHP ${{ matrix.php-version }} on ${{ matrix.os }}
name: Code coverage with PHP ${{ matrix.php-version }} on ${{ matrix.os }}
env:
php-extensions: intl, pcov
php-coverage: pcov
Expand All @@ -42,7 +43,7 @@ jobs:
with:
php-version: ${{ matrix.php-versions }}
extensions: ${{ env.php-extensions }}
key: vl-${{ matrix.os }}-php${{ matrix.php-version }}-${{ hashFiles('composer.json', 'composer.lock', 'package.json', 'package.lock') }}
key: vl-${{ matrix.os }}-php${{ matrix.php-version }}-node${{ matrix.node-version }}-${{ hashFiles('composer.json', 'composer.lock', 'package.json', 'package.lock') }}

- name: Get Composer cache directory
id: composer-cache
Expand All @@ -61,16 +62,24 @@ jobs:
key: ${{ steps.extcache.outputs.key }}
restore-keys: vl-${{ matrix.os }}-php${{ matrix.php-version }}-

- uses: shivammathur/setup-php@9e72090525849c5e82e596468b86eb55e9cc5401
- name: Setup PHP
uses: shivammathur/setup-php@9e72090525849c5e82e596468b86eb55e9cc5401
with:
php-version: ${{ matrix.php-version }}
extensions: ${{ env.php-extensions }}
coverage: ${{ env.php-coverage }}

- name: Install Dependencies
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: 'src'

- name: Install PHP and Node dependencies
run: |
composer self-update && composer install --no-interaction --no-progress --prefer-dist -vv
npm run build
composer self-update && composer install --no-interaction --no-progress --prefer-dist -vv
- name: Prepare Env.
run: |
Expand Down

0 comments on commit 56775dc

Please sign in to comment.