Skip to content

Commit e188a52

Browse files
CopilotBoshen
andauthored
Add CI workflow to test, lint and build (#20)
* Initial plan * Add CI workflow for testing, linting, and building Co-authored-by: Boshen <[email protected]> * Enhance CI workflow with better build verification Co-authored-by: Boshen <[email protected]> * Remove strategy matrix and use Node.js LTS Co-authored-by: Boshen <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: Boshen <[email protected]>
1 parent 7d1df13 commit e188a52

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

.github/workflows/ci.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main, develop ]
8+
9+
jobs:
10+
test-lint-build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- name: Setup Node.js LTS
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: 'lts/*'
21+
22+
- name: Setup pnpm
23+
uses: pnpm/action-setup@v4
24+
25+
- name: Get pnpm store directory
26+
shell: bash
27+
run: |
28+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
29+
30+
- name: Setup pnpm cache
31+
uses: actions/cache@v4
32+
with:
33+
path: ${{ env.STORE_PATH }}
34+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
35+
restore-keys: |
36+
${{ runner.os }}-pnpm-store-
37+
38+
- name: Install dependencies
39+
run: pnpm install --frozen-lockfile
40+
41+
- name: Lint code
42+
run: pnpm lint
43+
44+
- name: Run tests
45+
run: pnpm test
46+
47+
- name: Build project
48+
run: pnpm build
49+
50+
- name: Check build artifacts
51+
run: |
52+
if [ -d "apps/dashboard/dist" ]; then
53+
echo "✅ Build artifacts created successfully"
54+
ls -la apps/dashboard/dist/
55+
else
56+
echo "❌ Build artifacts not found"
57+
exit 1
58+
fi

0 commit comments

Comments
 (0)