63 lines
1.5 KiB
YAML
63 lines
1.5 KiB
YAML
name: CI Pipeline
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
pull_request:
|
|
branches: [ main ]
|
|
|
|
jobs:
|
|
test_frontend:
|
|
name: Lint & Test Frontend
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: ./monorepo
|
|
steps:
|
|
- name: Checkout Code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '18'
|
|
cache: 'npm'
|
|
cache-dependency-path: 'monorepo/package-lock.json'
|
|
|
|
- name: Install Dependencies
|
|
run: npm install
|
|
|
|
- name: Lint Frontend
|
|
run: npx nx lint frontend
|
|
|
|
- name: Test Frontend
|
|
run: npx nx test frontend
|
|
|
|
test_backend:
|
|
name: Test Backend
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout Code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up PHP
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: '8.2'
|
|
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite
|
|
coverage: none
|
|
|
|
- name: Install Composer Dependencies
|
|
working-directory: ./monorepo/apps/backend
|
|
run: composer install --prefer-dist --no-progress
|
|
|
|
- name: Prepare Laravel Environment
|
|
working-directory: ./monorepo/apps/backend
|
|
run: |
|
|
cp .env.example .env
|
|
php artisan key:generate
|
|
|
|
- name: Run PHPUnit Tests
|
|
working-directory: ./monorepo/apps/backend
|
|
run: php artisan test
|