Skip to content

Commit 4d1bb81

Browse files
ikidnapmyselfclaude
andcommitted
ci: add seo-checkup (local build on PRs, production on master) and extract shared setup action
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 4a9d2ec commit 4d1bb81

3 files changed

Lines changed: 73 additions & 28 deletions

File tree

.github/actions/setup/action.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Setup
2+
description: Install PHP and Composer dependencies, optionally Node dependencies and the built frontend
3+
4+
inputs:
5+
extensions:
6+
description: PHP extensions to enable
7+
default: mbstring, pdo, pdo_mysql, xml, curl
8+
coverage:
9+
description: PHP coverage driver (none, pcov, xdebug)
10+
default: none
11+
frontend:
12+
description: Install Node dependencies and build the frontend
13+
default: 'false'
14+
15+
runs:
16+
using: composite
17+
steps:
18+
- name: Setup PHP 8.3
19+
uses: shivammathur/setup-php@v2
20+
with:
21+
php-version: '8.3'
22+
extensions: ${{ inputs.extensions }}
23+
coverage: ${{ inputs.coverage }}
24+
25+
- name: Install Dependencies
26+
shell: bash
27+
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
28+
29+
- name: Setup Node
30+
if: inputs.frontend == 'true'
31+
uses: actions/setup-node@v4
32+
with:
33+
node-version: '20'
34+
cache: npm
35+
36+
- name: Install Node Dependencies
37+
if: inputs.frontend == 'true'
38+
shell: bash
39+
run: npm ci
40+
41+
- name: Build Frontend
42+
if: inputs.frontend == 'true'
43+
shell: bash
44+
run: npm run build

.github/workflows/ci.yml

Lines changed: 21 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,7 @@ jobs:
1111
steps:
1212
- uses: actions/checkout@v4
1313

14-
- name: Setup PHP 8.3
15-
uses: shivammathur/setup-php@v2
16-
with:
17-
php-version: '8.3'
18-
extensions: mbstring, pdo, pdo_mysql, xml, curl
19-
coverage: none
20-
21-
- name: Install Dependencies
22-
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
14+
- uses: ./.github/actions/setup
2315

2416
- name: Check formatting (Pint)
2517
run: vendor/bin/pint --test
@@ -55,31 +47,14 @@ jobs:
5547
steps:
5648
- uses: actions/checkout@v4
5749

58-
- name: Setup PHP 8.3
59-
uses: shivammathur/setup-php@v2
50+
- uses: ./.github/actions/setup
6051
with:
61-
php-version: '8.3'
62-
extensions: mbstring, pdo, pdo_mysql, xml, curl
6352
coverage: pcov
53+
frontend: 'true'
6454

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

68-
- name: Install Dependencies
69-
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
70-
71-
- name: Setup Node
72-
uses: actions/setup-node@v4
73-
with:
74-
node-version: '20'
75-
cache: npm
76-
77-
- name: Install Node Dependencies
78-
run: npm ci
79-
80-
- name: Build Frontend
81-
run: npm run build
82-
8358
- name: Generate App Key
8459
run: php artisan key:generate
8560

@@ -102,8 +77,26 @@ jobs:
10277
- name: Run Tests
10378
run: vendor/bin/phpunit --coverage-clover coverage.xml
10479

80+
- name: SEO check (local build)
81+
if: github.event_name == 'pull_request'
82+
uses: ikidnapmyself/seo-checkup@v1
83+
with:
84+
serve: php artisan serve
85+
serve-url: http://localhost:8000
86+
fail-on: recommended
87+
10588
- name: Upload Coverage to Coveralls
10689
uses: coverallsapp/github-action@v2
10790
with:
10891
file: coverage.xml
10992
format: clover
93+
94+
seo-production:
95+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
96+
runs-on: ubuntu-latest
97+
98+
steps:
99+
- uses: ikidnapmyself/seo-checkup@v1
100+
with:
101+
url: ${{ vars.PRODUCTION_URL }}
102+
fail-on: recommended
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# SEO Checkup — design
2+
3+
Add `ikidnapmyself/seo-checkup@v1` to the existing `ci.yml`; no new workflow.
4+
5+
- `tests` job, after PHPUnit, on `pull_request` only: serve the already-built, already-migrated app with `php artisan serve` and audit `/`.
6+
- `seo-production` job on push to `master` (deploy): audit `vars.PRODUCTION_URL` (repo variable, must be set).
7+
- `fail-on: recommended` for both.
8+
- Shared PHP/Composer/Node/build steps extracted into `.github/actions/setup`.

0 commit comments

Comments
 (0)