Skip to content

Commit e894614

Browse files
committed
add vitest and workflows
1 parent 677b722 commit e894614

File tree

8 files changed

+949
-18
lines changed

8 files changed

+949
-18
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Dependency Update Check
2+
3+
on:
4+
schedule:
5+
- cron: '0 7 * * 6' # Runs every Saturday at 7am
6+
workflow_dispatch:
7+
8+
jobs:
9+
update-dependencies:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v2
15+
16+
- name: Set up Node.js
17+
uses: actions/setup-node@v2
18+
with:
19+
node-version: '21.7.1'
20+
21+
- name: Install dependencies
22+
run: pnpm install
23+
24+
- name: Check for outdated dependencies
25+
run: pnpm outdated || true
26+
27+
- name: Update dependencies
28+
run: pnpm update
29+
30+
- name: Commit and push changes
31+
run: |
32+
git config --local user.email "[email protected]"
33+
git config --local user.name "GitHub Action"
34+
git add package.json package-lock.json
35+
git commit -m "Update dependencies by GitHub Action"
36+
git push

.github/workflows/lint-and-test.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Lint and Test
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- 'feature/*'
8+
- 'bugfix/*'
9+
pull_request:
10+
branches:
11+
- main
12+
13+
jobs:
14+
lint:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v2
20+
21+
- name: Set up Node.js
22+
uses: actions/setup-node@v2
23+
with:
24+
node-version: '21.7.1'
25+
26+
- name: Install dependencies
27+
run: pnpm install
28+
29+
- name: Lint code
30+
run: pnpm run lint
31+
32+
test:
33+
runs-on: ubuntu-latest
34+
needs: lint
35+
36+
steps:
37+
- name: Checkout code
38+
uses: actions/checkout@v2
39+
40+
- name: Set up Node.js
41+
uses: actions/setup-node@v2
42+
with:
43+
node-version: '21.7.1'
44+
45+
- name: Install dependencies
46+
run: pnpm install
47+
48+
- name: Run tests
49+
run: pnpm test
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- 'tpn/*'
7+
pull_request:
8+
branches:
9+
- 'tpn/*'
10+
11+
jobs:
12+
test:
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
node-version: [16, 18, 20]
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v2
21+
22+
- name: Set up Node.js
23+
uses: actions/setup-node@v2
24+
with:
25+
node-version: ${{ matrix.node-version }}
26+
27+
- name: Install dependencies
28+
run: pnpm install
29+
30+
- name: Run tests
31+
run: pnpm test

apps/api/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22
"name": "api",
33
"scripts": {
44
"start": "vercel dev",
5-
"deploy": "vercel --prod"
5+
"deploy": "vercel --prod",
6+
"test": "vitest"
67
},
78
"dependencies": {
89
"hono": "^4.6.9"
910
},
1011
"devDependencies": {
11-
"vercel": "^32.4.1"
12+
"vercel": "^32.4.1",
13+
"vitest": "^2.1.4"
1214
}
1315
}

apps/www/package.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"dev": "next dev --turbopack",
77
"build": "next build",
88
"start": "next start",
9-
"lint": "next lint"
9+
"lint": "next lint",
10+
"test": "vitest"
1011
},
1112
"dependencies": {
1213
"@radix-ui/react-avatar": "^1.1.1",
@@ -28,13 +29,14 @@
2829
"tailwindcss-animate": "^1.0.7"
2930
},
3031
"devDependencies": {
31-
"typescript": "^5",
3232
"@types/node": "^20",
3333
"@types/react": "^18",
3434
"@types/react-dom": "^18",
35+
"eslint": "^8",
36+
"eslint-config-next": "15.0.2",
3537
"postcss": "^8",
3638
"tailwindcss": "^3.4.1",
37-
"eslint": "^8",
38-
"eslint-config-next": "15.0.2"
39+
"typescript": "^5",
40+
"vitest": "^2.1.4"
3941
}
4042
}

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
"build": "turbo build",
66
"dev": "turbo dev",
77
"lint": "turbo lint",
8+
"test": "turbo run test",
9+
"test:watch": "turbo run test:watch",
810
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
911
"plura-api": "cd ./apps/api && pnpm run start",
1012
"plura-web": "cd ./apps/www && pnpm run start"

0 commit comments

Comments
 (0)