-
Notifications
You must be signed in to change notification settings - Fork 216
91 lines (76 loc) · 2.25 KB
/
Copy pathci.yml
File metadata and controls
91 lines (76 loc) · 2.25 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: CI
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
# Allow this workflow to be called by deploy.yml as a reusable "test" gate.
workflow_call:
jobs:
python:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
# LFS disabled: the repo's LFS bandwidth budget is exhausted and the
# 254MB flood model isn't needed for tests (code falls back to the
# synthetic/demo model path, same as production).
lfs: false
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libgl1
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -e .
- name: Lint with flake8
run: |
flake8 src/ --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 src/ --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest tests/ -v --tb=short
frontend:
runs-on: ubuntu-latest
defaults:
run:
working-directory: frontend
steps:
- uses: actions/checkout@v7
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version: "20"
cache: "npm"
cache-dependency-path: frontend/package-lock.json
- name: Install dependencies
run: npm ci
- name: Type check and build
run: npm run build
docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Docker image
uses: docker/build-push-action@v5
with:
context: .
push: false
target: api
cache-from: type=gha
cache-to: type=gha,mode=max
# Aggregator job used as a required status check named "ci"
ci:
needs: [python, frontend, docker]
runs-on: ubuntu-latest
steps:
- name: All checks passed
run: echo "CI passed"