-
Notifications
You must be signed in to change notification settings - Fork 6
71 lines (67 loc) · 2.01 KB
/
Copy pathweb-ci.yml
File metadata and controls
71 lines (67 loc) · 2.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Web Stack CI
on: [push, pull_request]
jobs:
backend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install backend deps
run: |
python -m pip install --upgrade pip
pip install -r backend/requirements.txt
- name: Lint
run: |
black --check backend
isort --profile black --check-only backend
flake8 backend
mypy --ignore-missing-imports backend
- name: Test backend
env:
PYTHONPATH: .
run: pytest -q --cov=backend --cov-report=xml --cov-fail-under=85
- name: Bandit security scan
run: bandit -r backend -x backend/tests -q
frontend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18'
- name: Install and lint
working-directory: frontend
run: |
npm ci || npm install
npm run lint
npm run type-check
- name: Test
working-directory: frontend
run: npm test -- --coverage --passWithNoTests
- name: E2E placeholder
working-directory: frontend
run: npm run test:e2e
- name: Build
working-directory: frontend
run: npm run build
integration:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Compose build
run: |
docker compose version || true
docker compose build || docker-compose build
- name: Compose up
run: docker compose up -d || docker-compose up -d
- name: Wait for backend
run: |
for i in {1..30}; do curl -sf http://localhost:8000/api/health && break || sleep 2; done
- name: Smoke API
run: |
curl -sf http://localhost:8000/api/version
- name: Compose down
if: always()
run: docker compose down -v || docker-compose down -v