2024-06-18 16:18:27 -04:00
|
|
|
name: Tests
|
|
|
|
|
|
|
|
on: [ push, pull_request ]
|
|
|
|
|
|
|
|
jobs:
|
2025-01-29 17:31:39 -05:00
|
|
|
tests:
|
2024-09-11 16:43:53 -04:00
|
|
|
runs-on: ubuntu-latest
|
2024-06-18 16:18:27 -04:00
|
|
|
services:
|
|
|
|
mysql:
|
|
|
|
image: mysql:8.3
|
2025-01-28 22:21:20 -05:00
|
|
|
ports:
|
|
|
|
- 33306:3306
|
2025-01-29 17:31:39 -05:00
|
|
|
env:
|
|
|
|
MYSQL_DATABASE: test
|
|
|
|
MYSQL_ALLOW_EMPTY_PASSWORD: yes
|
2025-01-28 22:21:20 -05:00
|
|
|
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
|
2024-09-11 16:01:07 -04:00
|
|
|
|
2024-06-18 16:18:27 -04:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v4
|
2024-09-11 16:01:07 -04:00
|
|
|
|
2025-01-29 17:31:39 -05:00
|
|
|
- name: Setup
|
|
|
|
uses: ./.github/action/setup
|
2024-06-18 16:18:27 -04:00
|
|
|
with:
|
2025-01-29 17:31:39 -05:00
|
|
|
php-version: 8.3
|
2024-09-11 16:01:07 -04:00
|
|
|
|
2024-06-18 16:18:27 -04:00
|
|
|
- name: Install Composer Dependencies
|
2025-01-29 17:31:39 -05:00
|
|
|
run: composer install -q --no-interaction --no-progress --prefer-dist --optimize-autoloader
|
2024-09-11 16:01:07 -04:00
|
|
|
|
2025-01-29 17:31:39 -05:00
|
|
|
- name: Install NPM dependencies
|
2024-06-18 16:18:27 -04:00
|
|
|
run: npm ci
|
2024-09-11 16:01:07 -04:00
|
|
|
|
2024-06-18 19:31:35 -04:00
|
|
|
- name: Build Front-end Assets
|
|
|
|
run: npm run build
|
2024-09-11 16:01:07 -04:00
|
|
|
|
2024-06-18 16:18:27 -04:00
|
|
|
- name: Prepare Laravel Environment
|
|
|
|
run: |
|
|
|
|
php -r "file_exists('.env') || copy('.env.ci', '.env');"
|
|
|
|
php artisan key:generate
|
2024-06-27 23:20:21 -04:00
|
|
|
php artisan optimize
|
2024-09-11 16:01:07 -04:00
|
|
|
|
2024-06-18 16:18:27 -04:00
|
|
|
- name: Run Database Migrations
|
|
|
|
run: php artisan migrate
|
2024-09-11 16:01:07 -04:00
|
|
|
|
2024-06-18 16:18:27 -04:00
|
|
|
- name: Link Storage
|
|
|
|
run: php artisan storage:link
|
2024-09-11 16:01:07 -04:00
|
|
|
|
2024-06-18 16:18:27 -04:00
|
|
|
- name: Run Tests
|
2025-01-29 17:31:39 -05:00
|
|
|
run: php artisan test --compact
|
2024-09-11 16:01:07 -04:00
|
|
|
|
2024-06-18 17:36:41 -04:00
|
|
|
- name: Display Laravel Log
|
|
|
|
if: failure()
|
|
|
|
run: cat storage/logs/laravel.log
|