mirror of
https://github.com/sp-tarkov/forge.git
synced 2025-02-13 04:30:41 -05:00
54 lines
1.3 KiB
YAML
54 lines
1.3 KiB
YAML
name: Tests
|
|
|
|
on: [ push, pull_request ]
|
|
|
|
jobs:
|
|
tests:
|
|
runs-on: ubuntu-latest
|
|
services:
|
|
mysql:
|
|
image: mysql:8.3
|
|
ports:
|
|
- 33306:3306
|
|
env:
|
|
MYSQL_DATABASE: test
|
|
MYSQL_ALLOW_EMPTY_PASSWORD: yes
|
|
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup
|
|
uses: ./.github/action/setup
|
|
with:
|
|
php-version: 8.3
|
|
|
|
- name: Install Composer Dependencies
|
|
run: composer install -q --no-interaction --no-progress --prefer-dist --optimize-autoloader
|
|
|
|
- name: Install NPM dependencies
|
|
run: npm ci
|
|
|
|
- name: Build Front-end Assets
|
|
run: npm run build
|
|
|
|
- name: Prepare Laravel Environment
|
|
run: |
|
|
php -r "file_exists('.env') || copy('.env.ci', '.env');"
|
|
php artisan key:generate
|
|
php artisan optimize
|
|
|
|
- name: Run Database Migrations
|
|
run: php artisan migrate
|
|
|
|
- name: Link Storage
|
|
run: php artisan storage:link
|
|
|
|
- name: Run Tests
|
|
run: php artisan test
|
|
|
|
- name: Display Laravel Log
|
|
if: failure()
|
|
run: cat storage/logs/laravel.log
|