Skip to content
Open
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
70 changes: 70 additions & 0 deletions .github/workflows/build-demos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Build Demo Apps

on:
workflow_dispatch:
pull_request:
branches: [ main ]

jobs:
build-demos:
name: Build demo/${{ matrix.app }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
app: [next-app, vite-project, adonisjs, react-router-app]
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 20.12.2

- name: Install pnpm
uses: pnpm/action-setup@v4
id: pnpm-install
with:
version: 9.12.3
run_install: false

- name: Configure pnpm cache
id: pnpm-cache
run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT

- name: Restore pnpm cache
uses: actions/cache@v3
Copy link

Copilot AI Nov 12, 2025

Choose a reason for hiding this comment

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

The actions/cache@v3 action is outdated. Since actions/upload-artifact@v4 is being used elsewhere in this workflow (line 66), it would be more consistent to use actions/cache@v4 here as well. Using the latest version provides better performance and compatibility with current GitHub Actions infrastructure.

Suggested change
uses: actions/cache@v3
uses: actions/cache@v4

Copilot uses AI. Check for mistakes.
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Setup Turbo telemetry
run: pnpm turbo telemetry disable

- name: Configure Turbo cache
uses: dtinth/setup-github-actions-caching-for-turbo@v1

- name: Build demo app
env:
CI: true
run: |
mkdir -p logs
pnpm turbo build --force --filter ./demo/${{ matrix.app }} 2>&1 | tee logs/build-${{ matrix.app }}.log
Copy link

Copilot AI Nov 12, 2025

Choose a reason for hiding this comment

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

The --force flag forces Turbo to rebuild without using cache, which defeats the purpose of setting up Turbo caching in line 54-55. This will significantly slow down CI runs. Consider removing the --force flag to allow Turbo to use its cache for faster builds, or document why cache invalidation is necessary for these builds.

Suggested change
pnpm turbo build --force --filter ./demo/${{ matrix.app }} 2>&1 | tee logs/build-${{ matrix.app }}.log
pnpm turbo build --filter ./demo/${{ matrix.app }} 2>&1 | tee logs/build-${{ matrix.app }}.log

Copilot uses AI. Check for mistakes.

- name: Upload build logs (on failure)
if: failure()
uses: actions/upload-artifact@v4
with:
name: build-logs-${{ matrix.app }}
path: logs/build-${{ matrix.app }}.log
if-no-files-found: ignore