## Summary - Upgrade Next.js from 16.1.6 to 16.2.3 - Add `suppressHydrationWarning` to `<html>` tag to fix `next-themes` hydration mismatch - Remove unnecessary `isClient` guard in `ThemeProvider` that caused script tag warning - Redirect unauthenticated `/roadmap` visitors to `/login` instead of `/` ## Test plan - [ ] Verify `/roadmap` redirects to `/login` when not logged in - [ ] Verify `/roadmap` loads correctly when logged in as team member - [ ] Verify no hydration warnings in browser console - [ ] Verify dark/light theme switching still works
89 lines
2.1 KiB
YAML
89 lines
2.1 KiB
YAML
name: CF-API CI
|
|
|
|
permissions:
|
|
contents: read
|
|
pull-requests: read
|
|
|
|
on:
|
|
pull_request:
|
|
paths:
|
|
- 'js/cf-api/**'
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
# This job checks if the workflow should run based on file changes
|
|
check-changes:
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
should-run: ${{ steps.filter.outputs.cfapi }}
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 0
|
|
- uses: dorny/paths-filter@v4
|
|
id: filter
|
|
with:
|
|
filters: |
|
|
cfapi:
|
|
- 'js/cf-api/**'
|
|
|
|
# This job always runs and succeeds, allowing PRs to be merged when paths don't match
|
|
skip-validate:
|
|
needs: check-changes
|
|
if: needs.check-changes.outputs.should-run != 'true'
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Skip validation
|
|
run: echo "Skipping CF-API validation - no changes in js/cf-api/"
|
|
|
|
validate:
|
|
needs: check-changes
|
|
if: needs.check-changes.outputs.should-run == 'true'
|
|
env:
|
|
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
packages: read
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: '20'
|
|
registry-url: https://npm.pkg.github.com
|
|
scope: '@codeflash-ai'
|
|
cache: 'npm'
|
|
cache-dependency-path: 'js/cf-api/package-lock.json'
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
cd js/cf-api
|
|
npm ci
|
|
|
|
- name: Run tests
|
|
run: |
|
|
cd js/cf-api
|
|
NODE_OPTIONS=--experimental-vm-modules npx jest --ci --config jest.config.cjs
|
|
|
|
- name: Build
|
|
run: |
|
|
cd js/cf-api
|
|
npm run build
|
|
|
|
# - name: Type check
|
|
# run: |
|
|
# cd js/cf-api
|
|
# npx tsc --noEmit
|
|
#
|
|
# - name: Lint
|
|
# run: |
|
|
# cd js/cf-api
|
|
# npx eslint . --ext .ts,.mjs
|