Files
Epicnabbo-Catalogus-Updated…/Updated_Cms/.github/workflows/laravel.yml
T
2026-01-20 21:46:23 +01:00

84 lines
2.5 KiB
YAML

name: Laravel
on:
push:
branches: [ "main", "dev" ]
pull_request:
branches: [ "main", "dev" ]
jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
php-version: [8.4, 8.5]
services:
mariadb:
image: mariadb:11
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: atomcms_testing
ports:
- 3306:3306
options: --health-cmd="healthcheck.sh --connect --innodb_initialized" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Cache composer dependencies
uses: actions/cache@v4
with:
path: vendor
key: composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
composer-
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
- name: Install composer dependencies
run: |
composer install --no-scripts
- name: Enable Corepack (Yarn)
run: corepack enable
- name: Install Yarn dependencies
run: yarn install --silent
- name: Compile assets (Atom)
run: yarn run build:atom
- name: Prepare Laravel Application
run: |
cp .env.testing.example .env.testing
# Override database config for GitHub Actions
sed -i 's/DB_USERNAME=docker/DB_USERNAME=root/' .env.testing
sed -i 's/DB_PASSWORD=password/DB_PASSWORD=/' .env.testing
sed -i 's/DB_DATABASE=testing/DB_DATABASE=atomcms_testing/' .env.testing
php artisan key:generate --env=testing
- name: Debug Laravel Configuration
run: |
php artisan config:cache --env=testing
php artisan route:cache --env=testing
php artisan view:cache --env=testing
- name: Create storage directories
run: |
mkdir -p storage/app/public
mkdir -p storage/framework/cache
mkdir -p storage/framework/sessions
mkdir -p storage/framework/views
mkdir -p storage/logs
chmod -R 755 storage
- name: Run Test suite with debug
run: |
php artisan test --env=testing --stop-on-failure