mirror of
https://github.com/open-webui/open-webui.git
synced 2026-11-23 06:00:42 -05:00
Our workflows refer to actions by tag, and a tag can be moved to different code after we reviewed it. This adds GitHub's workflow lockfile, which records the exact commit behind each action version, and the workflows now name exact releases (v5.1.0 instead of v5, for example) as the lockfile tool requires. Dependabot already tracks these actions. The regression workflow that follows the tests repo's main branch is not covered.
66 lines
2.2 KiB
YAML
66 lines
2.2 KiB
YAML
# ─────────────────────────────────────────────────────────────────────────────
|
|
# Frontend CI — Lint, format check, build, and unit tests
|
|
# Runs on pushes and PRs to main/dev, skipping backend-only changes
|
|
# ─────────────────────────────────────────────────────────────────────────────
|
|
name: Frontend Build
|
|
|
|
on:
|
|
push:
|
|
branches: [main, dev]
|
|
paths-ignore: ['backend/**', 'pyproject.toml', 'uv.lock']
|
|
pull_request:
|
|
branches: [main, dev]
|
|
paths-ignore: ['backend/**', 'pyproject.toml', 'uv.lock']
|
|
|
|
concurrency:
|
|
group: frontend-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
# ── Format, i18n, and production build ────────────────────────────────────
|
|
format-and-build:
|
|
name: Format & Build
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 15
|
|
steps:
|
|
- uses: actions/checkout@v5.1.0
|
|
|
|
- uses: actions/setup-node@v5.0.0
|
|
with:
|
|
node-version: '22'
|
|
|
|
- name: Install dependencies
|
|
run: npm install --force
|
|
|
|
- name: Verify code formatting
|
|
run: npm run format
|
|
|
|
- name: Verify i18n strings
|
|
run: npm run i18n:parse
|
|
|
|
- name: Ensure working tree is clean
|
|
run: git diff --exit-code
|
|
|
|
- name: Production build
|
|
run: npm run build
|
|
env:
|
|
NODE_OPTIONS: --max-old-space-size=8192
|
|
|
|
# ── Vitest unit tests ────────────────────────────────────────────────────
|
|
unit-tests:
|
|
name: Unit Tests
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
steps:
|
|
- uses: actions/checkout@v5.1.0
|
|
|
|
- uses: actions/setup-node@v5.0.0
|
|
with:
|
|
node-version: '22'
|
|
|
|
- name: Install dependencies (frozen lockfile)
|
|
run: npm ci --force
|
|
|
|
- name: Execute test suite
|
|
run: npm run test:frontend
|