Skip to content

Commit 8ec513c

Browse files
committed
ci: add GitHub Actions workflow for automated testing
1 parent f8bc4b4 commit 8ec513c

File tree

3 files changed

+53
-1
lines changed

3 files changed

+53
-1
lines changed

.devcontainer/devcontainer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,8 @@
1313
"vitest.explorer"
1414
]
1515
}
16+
},
17+
"features": {
18+
"ghcr.io/anthropics/devcontainer-features/claude-code:1.0.5": {}
1619
}
1720
}

.github/workflows/test.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches: [main, 14-add-ci]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
node-version: [18.x, 20.x, 22.x]
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Use Node.js ${{ matrix.node-version }}
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: ${{ matrix.node-version }}
24+
cache: 'pnpm'
25+
26+
- name: Install pnpm
27+
uses: pnpm/action-setup@v4
28+
with:
29+
version: latest
30+
run_install: false
31+
32+
- name: Install dependencies
33+
run: pnpm install --frozen-lockfile
34+
35+
- name: Run lint
36+
run: pnpm run lint
37+
38+
- name: Run tests with coverage
39+
run: pnpm run test:cov
40+
41+
- name: Upload coverage to Codecov
42+
uses: codecov/codecov-action@v3
43+
with:
44+
token: ${{ secrets.CODECOV_TOKEN }}
45+
file: ./coverage/coverage-final.json
46+
slug: onozaty/prisma-db-comments-generator
47+
48+
- name: Build
49+
run: pnpm run build

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"build": "rm -rf dist/ && node build.js",
1515
"prepare": "pnpm run build",
1616
"format": "prettier --write src/**",
17-
"lint": "eslint src/**",
17+
"lint": "eslint 'src/**/*.ts' --ignore-pattern 'src/__fixtures__/**'",
1818
"test": "vitest run",
1919
"test:cov": "vitest run --coverage",
2020
"db:migrate": "prisma migrate dev && prisma generate && pnpm run db:deploy",

0 commit comments

Comments
 (0)