Added Cache to CICD
Some checks failed
linter / quality (push) Successful in 11m58s
tests / ci (8.4) (push) Failing after 7m52s
tests / ci (8.5) (push) Has been cancelled

This commit is contained in:
2026-03-23 16:13:12 +01:00
parent 5880024933
commit b052d792f8
2 changed files with 91 additions and 28 deletions

View File

@@ -25,32 +25,66 @@ jobs:
- name: Checkout code
uses: actions/checkout@v6
# -------------------------
# Cache Composer
# -------------------------
- name: Cache Composer dependencies
uses: actions/cache@v4
with:
path: ~/.composer/cache
key: composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
composer-${{ runner.os }}-${{ matrix.php-version }}-
# -------------------------
# Cache Node
# -------------------------
- name: Cache Node dependencies
uses: actions/cache@v4
with:
path: ~/.npm
key: node-${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
node-${{ runner.os }}-
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: composer:v2
coverage: xdebug
coverage: none
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
# -------------------------
# Install dependencies
# -------------------------
- name: Install Node Dependencies
run: npm i
run: npm ci
- name: Install Dependencies
run: composer install --no-interaction --prefer-dist --optimize-autoloader
- name: Install PHP Dependencies
run: composer install --no-interaction --prefer-dist --optimize-autoloader --no-progress
- name: Copy Environment File
run: cp .env.example .env
- name: Generate Application Key
run: php artisan key:generate
# -------------------------
# Laravel setup
# -------------------------
- name: Prepare environment
run: |
cp .env.example .env
php artisan key:generate
# -------------------------
# Build (optional remove if not needed for tests)
# -------------------------
- name: Build Assets
run: npm run build
- name: Tests
run: ./vendor/bin/phpunit
# -------------------------
# Run tests (parallel)
# -------------------------
- name: Run Tests
run: php artisan test --parallel