feat: Add Upstream Sync Workflow #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Website CI | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'apps/web/**' | |
| - 'packages/manifest/**' | |
| - 'acfs.manifest.yaml' | |
| - '.github/workflows/website.yml' | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - 'apps/web/**' | |
| - 'packages/manifest/**' | |
| - 'acfs.manifest.yaml' | |
| - '.github/workflows/website.yml' | |
| jobs: | |
| verify-generated: | |
| name: Verify Generated Files | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Cache Bun dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.bun/install/cache | |
| key: ${{ runner.os }}-bun-manifest-${{ hashFiles('packages/manifest/bun.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-bun-manifest- | |
| - name: Install manifest package dependencies | |
| working-directory: packages/manifest | |
| run: bun install --frozen-lockfile | |
| - name: Verify generated files match manifest | |
| working-directory: packages/manifest | |
| run: | | |
| echo "Checking if generated files are in sync with acfs.manifest.yaml..." | |
| bun run generate:diff | |
| echo "✓ Generated files are up to date" | |
| lint-and-typecheck: | |
| name: Lint & Type Check | |
| runs-on: ubuntu-latest | |
| needs: verify-generated | |
| defaults: | |
| run: | |
| working-directory: apps/web | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Cache Bun dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.bun/install/cache | |
| key: ${{ runner.os }}-bun-${{ hashFiles('apps/web/bun.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-bun- | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Run ESLint | |
| run: bun run lint | |
| - name: Run TypeScript type check | |
| run: bun run type-check | |
| build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| needs: lint-and-typecheck | |
| defaults: | |
| run: | |
| working-directory: apps/web | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Cache Bun dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.bun/install/cache | |
| key: ${{ runner.os }}-bun-${{ hashFiles('apps/web/bun.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-bun- | |
| - name: Cache Next.js build | |
| uses: actions/cache@v4 | |
| with: | |
| path: apps/web/.next/cache | |
| key: ${{ runner.os }}-nextjs-${{ hashFiles('apps/web/bun.lock') }}-${{ hashFiles('apps/web/**/*.ts', 'apps/web/**/*.tsx') }} | |
| restore-keys: | | |
| ${{ runner.os }}-nextjs-${{ hashFiles('apps/web/bun.lock') }}- | |
| ${{ runner.os }}-nextjs- | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Build | |
| run: bun run build | |
| e2e-tests: | |
| name: E2E Tests | |
| runs-on: ubuntu-latest | |
| needs: build | |
| defaults: | |
| run: | |
| working-directory: apps/web | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| project: [chromium, firefox, webkit, 'Mobile Chrome', 'Mobile Safari'] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Cache Bun dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.bun/install/cache | |
| key: ${{ runner.os }}-bun-${{ hashFiles('apps/web/bun.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-bun- | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Install Playwright browsers | |
| run: | | |
| case "${{ matrix.project }}" in | |
| chromium) browser=chromium ;; | |
| firefox) browser=firefox ;; | |
| webkit) browser=webkit ;; | |
| "Mobile Chrome") browser=chromium ;; | |
| *) browser=webkit ;; | |
| esac | |
| bunx playwright install --with-deps "$browser" | |
| - name: Run Playwright tests | |
| run: bun run test --project="${{ matrix.project }}" | |
| env: | |
| CI: true | |
| - name: Upload test results | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: playwright-report-${{ matrix.project }} | |
| path: | | |
| apps/web/playwright-report/ | |
| apps/web/test-results/ | |
| retention-days: 30 |