Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 84 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: CI

on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
backend:
name: backend (Laravel)
runs-on: ubuntu-latest
timeout-minutes: 15

# phpunit.xml points at PostgreSQL (DB_CONNECTION=pgsql, DB_DATABASE=workless_test),
# so the tests need a real database, not SQLite.
services:
postgres:
image: postgres:16
env:
POSTGRES_DB: workless_test
POSTGRES_USER: workless
POSTGRES_PASSWORD: workless_secret
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5

defaults:
run:
working-directory: backend

steps:
- uses: actions/checkout@v4

- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: "8.3"
extensions: mbstring, pdo_pgsql, pgsql, bcmath, gd, zip, xml, curl, intl
coverage: none

- name: Install dependencies
run: composer install --prefer-dist --no-interaction --no-progress

- name: Prepare environment
run: |
cp .env.example .env
php artisan key:generate

- name: Run tests
run: php artisan test

frontend:
name: frontend (Next.js)
runs-on: ubuntu-latest
timeout-minutes: 10

defaults:
run:
working-directory: frontend

steps:
- uses: actions/checkout@v4

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: "22"
cache: npm
cache-dependency-path: frontend/package-lock.json

- name: Install
run: npm ci

- name: Build
run: npm run build
Loading