-
Notifications
You must be signed in to change notification settings - Fork 220
147 lines (120 loc) · 3.96 KB
/
mcp.yml
File metadata and controls
147 lines (120 loc) · 3.96 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
name: MCP
on:
push:
branches: ["main"]
pull_request:
merge_group:
permissions:
contents: read
concurrency:
group: mcp-${{ github.head_ref || github.ref_name || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
defaults:
run:
working-directory: mcp
jobs:
Lint:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout repository
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: "22"
cache: "npm"
cache-dependency-path: mcp/package-lock.json
- name: Install dependencies
run: npm ci
- name: Check formatting
run: npm run format:check
- name: Lint
run: npm run lint
Build:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout repository
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: "22"
cache: "npm"
cache-dependency-path: mcp/package-lock.json
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
Test:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout repository
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: "22"
cache: "npm"
cache-dependency-path: mcp/package-lock.json
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm test
Lock:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout repository
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: "22"
cache: "npm"
cache-dependency-path: mcp/package-lock.json
- name: Install dependencies
run: npm ci
- name: Check package-lock.json unchanged
run: |
if ! git diff --exit-code package-lock.json; then
echo "ERROR: package-lock.json was modified during install!"
echo "This suggests that the package-lock.json file in the repository is not up to date."
echo "Please run 'npm install' locally and commit the updated package-lock.json."
exit 1
fi
echo "✓ package-lock.json remained unchanged after npm ci"
Integration:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout repository
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: "22"
cache: "npm"
cache-dependency-path: mcp/package-lock.json
- name: Install dependencies
run: npm ci
- name: Create local D1 database
run: |
npx wrangler d1 execute commonware-mcp-search --local --file=migrations/0001_create_search_index.sql
- name: Start wrangler dev server
run: |
npx wrangler dev --test-scheduled --port 8787 &
echo "Waiting for server to start..."
for i in {1..30}; do
if curl -s http://localhost:8787/health > /dev/null 2>&1; then
echo "Server is ready"
exit 0
fi
sleep 1
done
echo "ERROR: Server failed to start within 30 seconds"
exit 1
- name: Run integration tests
run: node integration-test.mjs