Skip to content

refactor(cache): major caching refactor / migration -> cacheComponents #540

refactor(cache): major caching refactor / migration -> cacheComponents

refactor(cache): major caching refactor / migration -> cacheComponents #540

Workflow file for this run

# CI Pipeline
# Optimizations: path-based filtering, parallel jobs, shallow clones (fetch-depth: 1), Turbo cache
# Uses actions/checkout@v6 for improved performance and sparse checkout support
name: CI
on:
pull_request:
branches: [main]
push:
branches: [main]
# Cancel in-progress runs when new commits pushed (saves resources)
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
# Required for Turbo remote cache; builds without these use local cache only
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
jobs:
# Fast path detection - only checkout minimal history needed for path filtering
changes:
name: Detect Changes
runs-on: ubuntu-latest
timeout-minutes: 2
outputs:
packages: ${{ steps.filter.outputs.packages }}
web: ${{ steps.filter.outputs.web }}
edge: ${{ steps.filter.outputs.edge }}
generators: ${{ steps.filter.outputs.generators }}
content: ${{ steps.filter.outputs.content }}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 1 # Shallow clone - only need current commit for path filtering
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
packages:
- 'packages/**'
web:
- 'apps/web/**'
edge:
- 'apps/edge/**'
generators:
- 'packages/generators/**'
content:
- 'content/**'
# Parallel jobs - run independently after changes detection
# Only run if relevant paths changed (saves resources)
type-check:
name: Type Check
needs: changes
if: needs.changes.outputs.packages == 'true' || needs.changes.outputs.web == 'true' || needs.changes.outputs.generators == 'true'
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
# Checkout first to make composite action files available
- uses: actions/checkout@v6
with:
fetch-depth: 1 # Shallow clone - only need current commit
- uses: ./.github/actions/setup
with:
skip-checkout: true # Already checked out above
- name: Type check
run: pnpm type-check
env:
TURBO_TOKEN: ${{ env.TURBO_TOKEN }}
TURBO_TEAM: ${{ env.TURBO_TEAM }}
lint:
name: Lint
needs: changes
if: needs.changes.outputs.packages == 'true' || needs.changes.outputs.web == 'true' || needs.changes.outputs.generators == 'true'
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
# Checkout first to make composite action files available
- uses: actions/checkout@v6
with:
fetch-depth: 1 # Shallow clone - only need current commit
- uses: ./.github/actions/setup
with:
skip-checkout: true # Already checked out above
- name: Lint
run: pnpm lint
env:
TURBO_TOKEN: ${{ env.TURBO_TOKEN }}
TURBO_TEAM: ${{ env.TURBO_TEAM }}
build:
name: Build
needs: changes
if: needs.changes.outputs.web == 'true' || needs.changes.outputs.packages == 'true' || needs.changes.outputs.generators == 'true'
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
# Checkout first to make composite action files available
- uses: actions/checkout@v6
with:
fetch-depth: 1 # Shallow clone - only need current commit
- uses: ./.github/actions/setup
with:
skip-checkout: true # Already checked out above
- name: Build
run: pnpm build
env:
NEXT_PUBLIC_SUPABASE_URL: ${{ secrets.NEXT_PUBLIC_SUPABASE_URL }}
NEXT_PUBLIC_SUPABASE_ANON_KEY: ${{ secrets.NEXT_PUBLIC_SUPABASE_ANON_KEY }}
TURBO_TOKEN: ${{ env.TURBO_TOKEN }}
TURBO_TEAM: ${{ env.TURBO_TEAM }}