Skip to content

Commit 0456a85

Browse files
authored
Merge pull request #45 from drivecore/fix-issue-44-ci-and-husky
Fix issue #44: Add CI workflow and update Husky configuration
2 parents 939f0e1 + cd0ec55 commit 0456a85

File tree

5 files changed

+48
-3
lines changed

5 files changed

+48
-3
lines changed

.github/workflows/ci.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- '*'
7+
pull_request:
8+
branches:
9+
- main
10+
11+
env:
12+
PNPM_VERSION: 10.2.1
13+
NODE_VERSION: 18
14+
15+
jobs:
16+
ci:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v3
20+
21+
- uses: pnpm/action-setup@v2
22+
with:
23+
version: ${{ env.PNPM_VERSION }}
24+
25+
- uses: actions/setup-node@v3
26+
with:
27+
node-version: ${{ env.NODE_VERSION }}
28+
cache: 'pnpm'
29+
30+
- name: Install dependencies
31+
run: pnpm install --frozen-lockfile
32+
33+
- name: Lint
34+
run: pnpm lint
35+
36+
- name: Build
37+
run: pnpm build
38+
39+
- name: TypeCheck
40+
run: pnpm typecheck

.husky/pre-commit

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#!/usr/bin/env sh
2-
. "$(dirname -- "$0")/_/husky.sh"
32

43
echo "Running pre-commit checks..."
54
pnpm pre-commit-check

.husky/pre-push

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
3+
echo "Running pre-push checks..."
4+
pnpm pre-commit-check

.nvmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
18

package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@
5757
},
5858
"lint-staged": {
5959
"*.{js,jsx,ts,tsx}": [
60-
"eslint --fix"
60+
"eslint --fix",
61+
"git add"
6162
]
6263
}
63-
}
64+
}

0 commit comments

Comments
 (0)