Skip to content

Commit fd9c19e

Browse files
Midoriya-wShantKhatri
authored andcommitted
feat: add CI pipeline with lint, typecheck, test, and PR title enforcement (#323)
1 parent a99c55a commit fd9c19e

2 files changed

Lines changed: 63 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: ["**"]
8+
9+
jobs:
10+
ci:
11+
name: Typecheck / Lint / Test (Node ${{ matrix.node-version }})
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
node-version: [18, 20]
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
21+
- name: Setup pnpm
22+
uses: pnpm/action-setup@v3
23+
with:
24+
version: 8
25+
26+
- name: Setup Node.js ${{ matrix.node-version }}
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: ${{ matrix.node-version }}
30+
cache: "pnpm"
31+
32+
- name: Install dependencies
33+
run: pnpm install --frozen-lockfile
34+
35+
- name: Typecheck
36+
run: pnpm -r run typecheck
37+
38+
- name: Lint
39+
run: pnpm -r run lint
40+
41+
- name: Test
42+
run: pnpm -r run test --coverage
43+
44+
- name: Upload coverage
45+
uses: actions/upload-artifact@v4
46+
with:
47+
name: coverage-node-${{ matrix.node-version }}
48+
path: "**/coverage"
49+
if-no-files-found: ignore

.github/workflows/pr-title.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: PR Title Check
2+
3+
on:
4+
pull_request:
5+
types: [opened, edited, synchronize, reopened]
6+
7+
jobs:
8+
pr-title:
9+
name: Enforce Conventional Commits
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: amannn/action-semantic-pull-request@v5
13+
env:
14+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)