Skip to content

Commit 5c19ab7

Browse files
committed
ci: add GitHub Actions CI pipeline with lint, type-check, and test jobs
1 parent d6d19db commit 5c19ab7

1 file changed

Lines changed: 114 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
lint:
11+
name: Lint
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Set up Python
17+
uses: actions/setup-python@v5
18+
with:
19+
python-version: "3.10"
20+
cache: "pip"
21+
22+
- name: Install backend dependencies
23+
run: pip install -r requirements.txt
24+
25+
- name: Ruff check
26+
run: ruff check .
27+
28+
- name: Ruff format
29+
run: ruff format --check
30+
31+
- name: Set up Node
32+
uses: actions/setup-node@v4
33+
with:
34+
node-version: "20"
35+
cache: "npm"
36+
cache-dependency-path: frontend/package-lock.json
37+
38+
- name: Install frontend dependencies
39+
working-directory: frontend
40+
run: npm install
41+
42+
- name: ESLint
43+
working-directory: frontend
44+
run: npm run lint
45+
46+
- name: Prettier
47+
working-directory: frontend
48+
run: npm run format
49+
50+
type-check:
51+
name: Type Check
52+
runs-on: ubuntu-latest
53+
steps:
54+
- uses: actions/checkout@v4
55+
56+
- name: Set up Python
57+
uses: actions/setup-python@v5
58+
with:
59+
python-version: "3.10"
60+
cache: "pip"
61+
62+
- name: Install backend dependencies
63+
run: pip install -r requirements.txt
64+
65+
- name: Pyright
66+
run: pyright backend/ mkg/
67+
68+
- name: Set up Node
69+
uses: actions/setup-node@v4
70+
with:
71+
node-version: "20"
72+
cache: "npm"
73+
cache-dependency-path: frontend/package-lock.json
74+
75+
- name: Install frontend dependencies
76+
working-directory: frontend
77+
run: npm install
78+
79+
- name: TypeScript check
80+
working-directory: frontend
81+
run: npm run typecheck
82+
83+
test:
84+
name: Test
85+
runs-on: ubuntu-latest
86+
steps:
87+
- uses: actions/checkout@v4
88+
89+
- name: Set up Python
90+
uses: actions/setup-python@v5
91+
with:
92+
python-version: "3.10"
93+
cache: "pip"
94+
95+
- name: Install backend dependencies
96+
run: pip install -r requirements.txt
97+
98+
- name: Run backend tests
99+
run: pytest tests/ -v
100+
101+
- name: Set up Node
102+
uses: actions/setup-node@v4
103+
with:
104+
node-version: "20"
105+
cache: "npm"
106+
cache-dependency-path: frontend/package-lock.json
107+
108+
- name: Install frontend dependencies
109+
working-directory: frontend
110+
run: npm install
111+
112+
- name: Run frontend tests
113+
working-directory: frontend
114+
run: npx vitest run

0 commit comments

Comments
 (0)