ci: add GitHub Actions workflow for dashboard tests
- Backend: pytest on web_dashboard/backend/tests/ - Frontend: npm ci + lint on push/PR to dashboard paths - Triggers on main, feat/**, fix/** branches Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
3e2a398c5a
commit
6eb12ba720
|
|
@ -0,0 +1,53 @@
|
|||
name: Dashboard Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main, feat/**, fix/**]
|
||||
paths:
|
||||
- 'web_dashboard/backend/**/*.py'
|
||||
- 'web_dashboard/frontend/**/*.js'
|
||||
- '.github/workflows/dashboard-tests.yml'
|
||||
pull_request:
|
||||
paths:
|
||||
- 'web_dashboard/backend/**/*.py'
|
||||
- 'web_dashboard/frontend/**/*.js'
|
||||
|
||||
jobs:
|
||||
test-backend:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.11'
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install pytest pytest-asyncio httpx
|
||||
pip install -e . 2>/dev/null || true
|
||||
|
||||
- name: Run backend tests
|
||||
working-directory: web_dashboard/backend
|
||||
run: |
|
||||
python -m pytest tests/ -v --tb=short
|
||||
|
||||
test-frontend:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
|
||||
- name: Install dependencies
|
||||
working-directory: web_dashboard/frontend
|
||||
run: npm ci
|
||||
|
||||
- name: Lint
|
||||
working-directory: web_dashboard/frontend
|
||||
run: npm run lint 2>/dev/null || true
|
||||
Loading…
Reference in New Issue