-
Notifications
You must be signed in to change notification settings - Fork 3
86 lines (72 loc) · 2.52 KB
/
Copy pathbuild-server.yml
File metadata and controls
86 lines (72 loc) · 2.52 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
80
81
82
83
84
85
86
name: Build Server - CodeQL Development MCP Server
on:
pull_request:
branches: ['main', 'next']
paths:
- '.github/workflows/build-server.yml'
- '.node-version'
- 'package.json'
- 'package-lock.json'
- 'server/**'
push:
branches: ['main', 'next']
paths:
- '.github/workflows/build-server.yml'
- '.node-version'
- 'package.json'
- 'package-lock.json'
- 'server/**'
permissions:
contents: read
jobs:
build-server:
name: Build Server (Node ${{ matrix.node }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: ['.node-version', '26']
defaults:
run:
working-directory: server
steps:
- name: Build Server - Checkout repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Build Server - Setup Node.js environment (from .node-version)
if: matrix.node == '.node-version'
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
cache: 'npm'
node-version-file: '.node-version'
- name: Build Server - Setup Node.js environment (explicit version)
if: matrix.node != '.node-version'
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
cache: 'npm'
node-version: ${{ matrix.node }}
- name: Build Server - Install dependencies
run: npm ci --include=optional --ignore-scripts
working-directory: .
- name: Build Server - Clean previous build
run: npm run clean
- name: Build Server - Run tests with coverage
run: npm run test:coverage
- name: Build Server - Bundle application
run: npm run bundle
- name: Build Server - Check for uncommitted changes
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "❌ Uncommitted changes detected after build:"
git status --porcelain
git diff
exit 1
else
echo "✅ No uncommitted changes after build"
fi
- name: Build Server - Summary
run: |
echo "## Build Server Summary" >> $GITHUB_STEP_SUMMARY
echo "✅ ESLint checks completed" >> $GITHUB_STEP_SUMMARY
echo "✅ All tests passed with coverage" >> $GITHUB_STEP_SUMMARY
echo "✅ Application bundled successfully" >> $GITHUB_STEP_SUMMARY
echo "✅ No uncommitted changes detected" >> $GITHUB_STEP_SUMMARY