Skip to content
Open
44 changes: 44 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Setup
description: Install PHP and Composer dependencies, optionally Node dependencies and the built frontend

inputs:
extensions:
description: PHP extensions to enable
default: mbstring, pdo, pdo_mysql, xml, curl
coverage:
description: PHP coverage driver (none, pcov, xdebug)
default: none
frontend:
description: Install Node dependencies and build the frontend
default: 'false'

runs:
using: composite
steps:
- name: Setup PHP 8.3
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
extensions: ${{ inputs.extensions }}
coverage: ${{ inputs.coverage }}

- name: Install Dependencies
shell: bash
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist

- name: Setup Node
if: inputs.frontend == 'true'
uses: actions/setup-node@v4
with:
node-version: '20'
cache: npm

- name: Install Node Dependencies
if: inputs.frontend == 'true'
shell: bash
run: npm ci

- name: Build Frontend
if: inputs.frontend == 'true'
shell: bash
run: npm run build
54 changes: 26 additions & 28 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ name: CI
on:
push:
pull_request:
workflow_dispatch:
inputs:
url:
description: URL to audit (defaults to the PRODUCTION_URL repo variable)
required: false

jobs:
quality:
Expand All @@ -11,15 +16,7 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup PHP 8.3
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
extensions: mbstring, pdo, pdo_mysql, xml, curl
coverage: none

- name: Install Dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
- uses: ./.github/actions/setup

- name: Check formatting (Pint)
run: vendor/bin/pint --test
Expand Down Expand Up @@ -55,31 +52,14 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup PHP 8.3
uses: shivammathur/setup-php@v2
- uses: ./.github/actions/setup
with:
php-version: '8.3'
extensions: mbstring, pdo, pdo_mysql, xml, curl
coverage: pcov
frontend: 'true'

- name: Copy .env
run: php -r "file_exists('.env') || copy('.env.example', '.env');"

- name: Install Dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20'
cache: npm

- name: Install Node Dependencies
run: npm ci

- name: Build Frontend
run: npm run build

- name: Generate App Key
run: php artisan key:generate

Expand All @@ -102,8 +82,26 @@ jobs:
- name: Run Tests
run: vendor/bin/phpunit --coverage-clover coverage.xml

- name: SEO check (local build)
if: github.event_name == 'pull_request'
uses: ikidnapmyself/seo-checkup@v1
with:
serve: php artisan migrate --force && php artisan serve
serve-url: http://localhost:8000
fail-on: recommended

- name: Upload Coverage to Coveralls
uses: coverallsapp/github-action@v2
with:
file: coverage.xml
format: clover

seo-production:
if: github.event_name != 'push' || github.ref == 'refs/heads/master'
runs-on: ubuntu-latest

steps:
- uses: ikidnapmyself/seo-checkup@v1
with:
url: ${{ inputs.url || vars.PRODUCTION_URL }}
fail-on: ${{ github.event_name == 'pull_request' && 'none' || 'recommended' }}
8 changes: 8 additions & 0 deletions docs/plans/2026-08-23-seo-checkup-design.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# SEO Checkup — design

Add `ikidnapmyself/seo-checkup@v1` to the existing `ci.yml`; no new workflow.

- `tests` job, after PHPUnit, on `pull_request` only: serve the already-built, already-migrated app with `php artisan serve` and audit `/`.
- `seo-production` job on push to `master` (deploy): audit `vars.PRODUCTION_URL` (repo variable, must be set).
- `fail-on: recommended` for both.
- Shared PHP/Composer/Node/build steps extracted into `.github/actions/setup`.
2 changes: 2 additions & 0 deletions resources/views/layout.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="csrf-token" content="{{ csrf_token() }}">
<title>{{ config('app.name') }}</title>
<meta name="description" content="@yield('meta-description', config('app.name'))">
<link rel="canonical" href="{{ url()->current() }}">
@vite(['resources/css/app.css', 'resources/js/app.js'])
@yield('page-data')
<script>window.__AUTH__ = @json(auth()->user()?->only(['id', 'name', 'email']));</script>
Expand Down
2 changes: 2 additions & 0 deletions resources/views/welcome.blade.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
@extends('layout')

@section('meta-description', config('app.name').' — real-time messaging threads for teams')

@section('page-data')
<script>
window.__PAGE__ = 'Welcome';
Expand Down
2 changes: 2 additions & 0 deletions tests/Feature/FrontEndTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ public function test_page_controller_index_method()

$response->assertOk();
$response->assertSee(Config::string('app.name'));
$response->assertSee('<meta name="description" content="', false);
$response->assertSee('<link rel="canonical" href="'.url('/').'">', false);
}

public function test_dashboard_shows_real_unread_counts_and_participant_ids(): void
Expand Down
Loading