Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 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
102 changes: 102 additions & 0 deletions .github/workflows/landing-visual.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: Landing Visual Regression

on:
pull_request:
branches:
- main
paths:
- 'shared/assets/**'
- 'templates/**/Landing*'
- 'templates/**/landing*'
- 'templates/**/page.module.css'
- 'templates/**/index.astro'
- 'templates/**/Newtab.*'
- 'templates/**/Popup.*'
- 'scripts/landing-visual/**'
workflow_dispatch:

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

permissions:
contents: read

jobs:
visual:
name: Visual regression on ${{ matrix.template }}
strategy:
fail-fast: false
matrix:
template:
- react-vite-starter
- nextjs-starter
- remix-starter
- astro-starter
- webextension-react-vite-starter
port:
- 5173
include:
- template: nextjs-starter
port: 3000
- template: astro-starter
port: 4321
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false

- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 22

- name: Install Playwright
working-directory: scripts/landing-visual
run: |
npm install
npx playwright install chromium --with-deps

- name: Scaffold test project
id: scaffold
continue-on-error: true
run: |
CI=true npx create-awesome-node-app visual-test-project \
-t "file://${PWD}?subdir=templates/${{ matrix.template }}"
echo "Project scaffolded"
Comment on lines +61 to +67

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Scaffold failures are silently swallowed, job reports success with no tests run.

continue-on-error: true on the scaffold step means its failure doesn't fail the job. Since all later steps (dev server, Playwright run, screenshot upload) are gated on steps.scaffold.outcome == 'success' and none of them run/fail in that case, the job conclusion is a false "success" — visual regression silently never executes.

🔧 Proposed fix
       - name: Scaffold test project
         id: scaffold
-        continue-on-error: true
         run: |
           CI=true npx create-awesome-node-app visual-test-project \
             -t "file://${PWD}?subdir=templates/${{ matrix.template }}"
           echo "Project scaffolded"

If scaffold flakiness needs tolerance, retry instead of masking failure, and add an explicit final step that fails the job when steps.scaffold.outcome != 'success'.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Scaffold test project
id: scaffold
continue-on-error: true
run: |
CI=true npx create-awesome-node-app visual-test-project \
-t "file://${PWD}?subdir=templates/${{ matrix.template }}"
echo "Project scaffolded"
- name: Scaffold test project
id: scaffold
run: |
CI=true npx create-awesome-node-app visual-test-project \
-t "file://${PWD}?subdir=templates/${{ matrix.template }}"
echo "Project scaffolded"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/landing-visual.yml around lines 61 - 67, The Scaffold test
project step in the landing visual workflow is masking failures with
continue-on-error, which can let the job finish green without running any visual
tests. Remove the silent success behavior from the scaffold step, or keep
tolerance only via retries, and add an explicit failure check after the scaffold
step that fails the job when steps.scaffold.outcome is not success so the
downstream dev server and Playwright steps cannot be skipped unnoticed.


- name: Start dev server
if: steps.scaffold.outcome == 'success'
working-directory: visual-test-project
run: |
npm install
if [ "${{ matrix.template }}" = "nextjs-starter" ]; then
npm run dev -- --port "${{ matrix.port }}" &
else
npm run dev -- --host 0.0.0.0 --port "${{ matrix.port }}" &
fi
echo "Waiting for dev server on port ${{ matrix.port }}..."
for i in $(seq 1 30); do
curl -sf "http://localhost:${{ matrix.port }}" > /dev/null 2>&1 && echo "Server ready on port ${{ matrix.port }}" && break
sleep 1
done
curl -sf "http://localhost:${{ matrix.port }}" > /dev/null 2>&1 || { echo "Server failed to start on port ${{ matrix.port }}"; exit 1; }

- name: Run visual tests
if: steps.scaffold.outcome == 'success'
working-directory: scripts/landing-visual
run: |
npx playwright test --project=chromium
env:
TEMPLATE: ${{ matrix.template }}
BASE_URL: http://localhost:${{ matrix.port }}

- name: Upload screenshots (always)
if: always() && steps.scaffold.outcome == 'success'
uses: actions/upload-artifact@v4
with:
name: screenshots-${{ matrix.template }}
path: |
scripts/landing-visual/test-results/
scripts/landing-visual/__screenshots__/
102 changes: 98 additions & 4 deletions .github/workflows/smoke-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,69 @@ on:
- reopened
workflow_dispatch:

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

permissions:
contents: read

jobs:
validate-registry:
name: Validate template registry
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 22
- name: Validate templates.json
run: node scripts/validate-templates.js

landing-audit:
name: Landing page audit
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 22
- name: Audit landing pages
run: node scripts/landing-audit.js

smoke-test:
name: Smoke test scaffolded projects
name: Smoke test ${{ matrix.template }}
needs: [validate-registry, landing-audit]
strategy:
fail-fast: false
matrix:
include:
- template: react-vite-starter
addons: ""
build-env: ""
- template: nextjs-starter
addons: ""
- template: nestjs-boilerplate
build-env: ""
- template: astro-starter
addons: ""
build-env: ""
- template: remix-starter
addons: ""
- template: react-vite-boilerplate
addons: '--addons "file://${PWD}?subdir=extensions/react-material-ui" "file://${PWD}?subdir=extensions/react-zustand"'
build-env: ""
- template: webextension-react-vite-starter
addons: ""
build-env: ""
- template: turborepo-starter
addons: ""
build-env: ""
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
Expand All @@ -47,6 +93,8 @@ jobs:

- name: Run basic checks
working-directory: smoke-test-project
env:
SKIP_ENV_VALIDATION: 'true'
run: |
npm install
npm run format --if-present
Expand All @@ -55,3 +103,49 @@ jobs:
npm run type-check --if-present || echo "Type-check warnings found (non-blocking)"
SKIP_ENV_VALIDATION=true npm run build --if-present || echo "Build warnings found (non-blocking)"
echo "Smoke test passed for ${{ matrix.template }}"

extension-isolation:
name: Isolate ${{ matrix.combination.template }} + ${{ matrix.combination.extension }}
needs: [validate-registry, landing-audit]
strategy:
fail-fast: false
matrix:
combination:
- template: react-vite-starter
extension: react-tailwindcss
- template: react-vite-starter
extension: react-shadcn
- template: react-vite-starter
extension: react-material-ui
- template: nextjs-starter
extension: nextjs-tailwindcss
- template: nextjs-starter
extension: nextjs-shadcn
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false

- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 22

- name: Scaffold with extension
run: |
CI=true npx create-awesome-node-app isolate-test-project \
-t "file://${PWD}?subdir=templates/${{ matrix.combination.template }}" \
--addons "file://${PWD}?subdir=extensions/${{ matrix.combination.extension }}"
echo "Project scaffolded with ${{ matrix.combination.extension }}"

- name: Run basic checks
working-directory: isolate-test-project
run: |
npm install
npm run format --if-present
npm run lint:fix --if-present
npm run lint --if-present || echo "Lint warnings found (non-blocking)"
npm run type-check --if-present || echo "Type-check warnings found (non-blocking)"
SKIP_ENV_VALIDATION=true npm run build --if-present || echo "Build warnings found (non-blocking)"
echo "Isolated test passed for ${{ matrix.combination.template }} + ${{ matrix.combination.extension }}"
22 changes: 14 additions & 8 deletions .github/workflows/test-combinations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,21 @@ on:
push:
branches:
- main
pull_request:
branches:
- main
types:
- opened
- synchronize
- reopened
schedule:
- cron: "0 0 * * 0" # Weekly full matrix on Sunday at midnight UTC
- cron: "0 0 * * 0"
workflow_dispatch:

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

permissions:
contents: read

Expand Down Expand Up @@ -43,7 +54,6 @@ jobs:
}));
const extensions = data.extensions;

// Build local URL for each extension using its url path
const extLocalUrl = (ext) => {
const match = ext.url.match(/\/extensions\/([^/]+)(?:\/|$)/);
const dir = match ? match[1] : null;
Expand Down Expand Up @@ -78,7 +88,6 @@ jobs:
if (ext) selectedExtensions.push(ext);
}

// Derive local template URL from the url field in templates.json
const tplMatch = template.url.match(/\/templates\/([^/]+)(?:\/|$)/);
const tplDir = tplMatch ? tplMatch[1] : null;
const templateUrl = tplDir ? \`file://${repoDir}?subdir=templates/${tplDir}\` : template.slug;
Expand All @@ -98,6 +107,7 @@ jobs:
matrix:
combination: ${{ fromJson(needs.generate-combinations.outputs.matrix) }}
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
Expand Down Expand Up @@ -138,7 +148,6 @@ jobs:

tree -I 'node_modules|dist|.git'

# Full matrix - tests ALL combinations (runs weekly, not on PRs)
generate-full-matrix:
name: Generate full test matrix
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
Expand Down Expand Up @@ -166,7 +175,6 @@ jobs:

const extensions = data.extensions;

// Build local URL for each extension using its url path
const extLocalUrl = (ext) => {
const match = ext.url.match(/\/extensions\/([^/]+)(?:\/|$)/);
const dir = match ? match[1] : null;
Expand All @@ -185,7 +193,6 @@ jobs:
return false;
};

// Generate ALL non-conflicting combinations (template x all compatible extensions)
const combinations = [];

for (const template of data.templates) {
Expand All @@ -194,7 +201,6 @@ jobs:
return extTypes.includes(template.type);
});

// Test with all mutually-compatible extensions for this template
const selectedExtensions = [];
for (const ext of compatibleExtensions) {
if (!hasIncompatibility(selectedExtensions, ext)) {
Expand All @@ -205,7 +211,6 @@ jobs:
if (selectedExtensions.length > 0) {
const extUrls = selectedExtensions.map(ext => extLocalUrl(ext)).filter(Boolean);

// Derive local template URL from the url field in templates.json
const tplMatch = template.url.match(/\/templates\/([^/]+)(?:\/|$)/);
const tplDir = tplMatch ? tplMatch[1] : null;
const templateUrl = tplDir ? \`file://${repoDir}?subdir=templates/${tplDir}\` : template.slug;
Expand All @@ -232,6 +237,7 @@ jobs:
matrix:
combination: ${{ fromJson(needs.generate-full-matrix.outputs.matrix) }}
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
Expand Down
Loading
Loading