76 lines
1.7 KiB
YAML
76 lines
1.7 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
tests:
|
|
name: Tests
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup PHP
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: '8.3'
|
|
extensions: mbstring, sqlite3, pdo_sqlite
|
|
coverage: none
|
|
|
|
- name: Install Composer dependencies
|
|
run: composer install --no-interaction --prefer-dist --optimize-autoloader
|
|
|
|
- name: Copy environment file
|
|
run: cp .env.example .env
|
|
|
|
- name: Generate application key
|
|
run: php artisan key:generate
|
|
|
|
- name: Run tests
|
|
run: php artisan test --parallel
|
|
env:
|
|
DB_CONNECTION: sqlite
|
|
DB_DATABASE: ':memory:'
|
|
|
|
lint:
|
|
name: Pint (Code Style)
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup PHP
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: '8.3'
|
|
coverage: none
|
|
|
|
- name: Install Composer dependencies
|
|
run: composer install --no-interaction --prefer-dist --optimize-autoloader
|
|
|
|
- name: Run Pint
|
|
run: vendor/bin/pint --test
|
|
|
|
static-analysis:
|
|
name: Larastan (Static Analysis)
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup PHP
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: '8.3'
|
|
coverage: none
|
|
|
|
- name: Install Composer dependencies
|
|
run: composer install --no-interaction --prefer-dist --optimize-autoloader
|
|
|
|
- name: Run Larastan
|
|
run: vendor/bin/phpstan analyse --memory-limit=512M
|