From 56775dc29d2ee1a98a761c7692dc511d03f4552d Mon Sep 17 00:00:00 2001 From: Sophist <3001893+Sophist-UK@users.noreply.github.com> Date: Fri, 3 Jan 2025 22:24:51 +0000 Subject: [PATCH] Add Node setup --- .github/workflows/codecov.yml | 13 +++++++++++-- .github/workflows/laravel-tests.yml | 19 ++++++++++++++----- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 4f679c3..c166d08 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -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 }} @@ -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 @@ -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 diff --git a/.github/workflows/laravel-tests.yml b/.github/workflows/laravel-tests.yml index 2e25ac0..c52f93e 100644 --- a/.github/workflows/laravel-tests.yml +++ b/.github/workflows/laravel-tests.yml @@ -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 @@ -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 @@ -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: |