Skip to content

add: weglot header to middleware #39

add: weglot header to middleware

add: weglot header to middleware #39

Workflow file for this run

name: PR Check
on:
pull_request:
branches: [ main, develop ]
jobs:
quality:
name: Code Quality & Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
- name: Run Biome check
run: pnpm check
- name: Run Biome format
run: pnpm format
- name: Type check
run: pnpm type-check
- name: Build packages
run: pnpm build:packages
- name: Build applications
env:
NEXT_TELEMETRY_DISABLED: 1
JWT_SECRET: ${{ secrets.JWT_SECRET || 'dummy-secret-for-ci' }}
NEXT_PUBLIC_WLD_APP_ID: ${{ secrets.NEXT_PUBLIC_WLD_APP_ID || 'app_staging_0' }}
NEXT_PUBLIC_API_URL: ${{ secrets.NEXT_PUBLIC_API_URL || 'http://localhost:3000' }}
NEXT_PUBLIC_ENVIRONMENT: 'preview'
run: pnpm build:apps
security:
name: Security Scan
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false
- name: Install dependencies
run: pnpm install
- name: Run security audit
run: pnpm check-deps
- name: Check for outdated dependencies
run: pnpm outdated || echo "Outdated dependencies found. Please review the report above."
bundle-analysis:
name: Bundle Analysis
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false
- name: Install dependencies
run: pnpm install
- name: Build and analyze bundle
env:
ANALYZE: true
NEXT_TELEMETRY_DISABLED: 1
JWT_SECRET: ${{ secrets.JWT_SECRET || 'dummy-secret-for-ci' }}
NEXT_PUBLIC_WLD_APP_ID: ${{ secrets.NEXT_PUBLIC_WLD_APP_ID || 'app_staging_0' }}
NEXT_PUBLIC_API_URL: ${{ secrets.NEXT_PUBLIC_API_URL || 'http://localhost:3000' }}
NEXT_PUBLIC_ENVIRONMENT: 'preview'
run: pnpm analyze
- name: Upload bundle analysis
if: success()
uses: actions/upload-artifact@v4
with:
name: bundle-analysis
path: |
apps/web/.next/analyze/client.html
apps/web/.next/analyze/edge.html
apps/web/.next/analyze/nodejs.html
compression-level: 9
retention-days: 14