Catch up #398
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Laravel CI | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
jobs: | |
javascript: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '22' | |
cache: 'npm' | |
- name: Install Dependencies | |
run: npm ci | |
- name: Run ESLint | |
run: npx eslint . | |
php: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: shivammathur/setup-php@15c43e89cdef867065b0213be354c2841860869e | |
with: | |
php-version: '8.4' | |
extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite, dom, filter, json, libxml, zip | |
- name: Copy .env | |
run: php -r "file_exists('.env') || copy('.env.example', '.env');" | |
- name: Install PHP Dependencies | |
run: composer install --prefer-dist --no-progress --no-interaction | |
- name: Run Pint | |
run: vendor/bin/pint --test | |
- name: Run PHPStan | |
run: vendor/bin/phpstan analyse --memory-limit=2G | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '22' | |
cache: 'npm' | |
- name: Install Node Dependencies | |
run: npm ci | |
- name: Build Frontend Assets | |
run: npm run build | |
- name: Set Environment Variables | |
run: | | |
echo "APP_ENV=testing" >> .env | |
echo "DB_CONNECTION=sqlite" >> .env | |
echo "DB_DATABASE=database/database.sqlite" >> .env | |
- name: Generate Application Key | |
run: php artisan key:generate | |
- name: Prepare Database | |
run: | | |
mkdir -p database | |
touch database/database.sqlite | |
- name: Migrate Database | |
env: | |
DB_CONNECTION: sqlite | |
DB_DATABASE: database/database.sqlite | |
run: php artisan migrate:fresh --force | |
- name: Run Tests | |
env: | |
APP_ENV: testing | |
DB_CONNECTION: sqlite | |
DB_DATABASE: database/database.sqlite | |
run: php artisan test |