-
Notifications
You must be signed in to change notification settings - Fork 4
79 lines (65 loc) · 2.06 KB
/
ci.yml
File metadata and controls
79 lines (65 loc) · 2.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: CI Build
on:
# Trigger on all pull requests to validate builds
pull_request:
branches: [ main ]
paths-ignore:
- '**.md'
- 'LICENSE'
- 'SECURITY.md'
# Trigger on pushes to branches (but not main, which is handled by deploy workflow)
push:
branches-ignore: [ main ]
paths-ignore:
- '**.md'
- 'LICENSE'
- 'SECURITY.md'
# Allow only one concurrent CI run per branch/PR
concurrency:
group: "ci-${{ github.head_ref || github.ref }}"
cancel-in-progress: true
permissions:
contents: read
jobs:
# Build validation job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: "20"
cache: 'npm'
- name: Install dependencies
run: npm install
- name: Lint code
run: npm run lint
- name: Run tests
run: npm run test:run
- name: Build application
run: npm run build
- name: Build for GitHub Pages
run: npm run build:pages
- name: Validate build outputs
run: |
echo "Validating standard build..."
if [ ! -f "dist/index.html" ]; then
echo "❌ Standard build failed: dist/index.html not found"
exit 1
fi
echo "✅ Standard build output validated"
echo "Validating GitHub Pages build..."
if [ ! -f "dist/index.html" ]; then
echo "❌ GitHub Pages build failed: dist/index.html not found"
exit 1
fi
echo "✅ GitHub Pages build output validated"
- name: Report build success
run: |
echo "🎉 CI Build completed successfully!"
echo "✅ Linting passed (with warnings allowed)"
echo "✅ All $( npm run test:run 2>&1 | grep -o '[0-9]\+ passed' | head -1 ) tests passed"
echo "✅ Standard build completed"
echo "✅ GitHub Pages build completed"