-
Notifications
You must be signed in to change notification settings - Fork 340
157 lines (123 loc) · 4.21 KB
/
Copy pathpr-test.yml
File metadata and controls
157 lines (123 loc) · 4.21 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
148
149
150
151
152
153
154
155
156
157
name: PR Test and Validation
on:
pull_request:
branches: [ main ]
types: [opened, synchronize, reopened]
workflow_dispatch:
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22.21.1'
cache: 'npm'
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Build project
run: npm run build
- name: Check runtime dependencies
run: npm run check:runtime-deps
- name: Run consumer install smoke test
run: npm run test:consumer-smoke
- name: Run mock tests
run: npm run test:mock
- name: Type check
run: npx tsc --noEmit
- name: Lint check
run: npm run lint || echo "No lint script found"
- name: Check package size
run: |
npm pack --dry-run --ignore-scripts
echo "Package created successfully"
- name: Security audit
run: npm audit --production || echo "Some vulnerabilities found"
continue-on-error: true
integration-test:
runs-on: ubuntu-latest
if: github.event_name == 'workflow_dispatch' || github.event.pull_request.draft == false
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Test Docker build
run: |
docker build -t mcp-gitlab-test .
echo "Verifying Docker image contains built files..."
docker run --rm --entrypoint "" mcp-gitlab-test ls -la build/index.js
echo "Docker build verification passed"
code-quality:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22.21.1'
cache: 'npm'
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Check code formatting
run: |
npx prettier --check "**/*.{js,ts,json,md}" || echo "Some files need formatting"
- name: Check for console.log statements
run: |
if grep -r "console\.log" --include="*.ts" --exclude-dir=node_modules --exclude-dir=build --exclude="test*.ts" .; then
echo "Warning: Found console.log statements in source code"
else
echo "No console.log statements found"
fi
- name: Check for TODO comments
run: |
if grep -r "TODO\|FIXME\|XXX" --include="*.ts" --exclude-dir=node_modules --exclude-dir=build .; then
echo "Warning: Found TODO/FIXME comments"
else
echo "No TODO/FIXME comments found"
fi
docs-build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
# actions/checkout@v4 — pin to commit SHA for supply-chain safety
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
with:
# Drop the GITHUB_TOKEN credential after checkout; this job only
# needs read access to the working tree.
persist-credentials: false
- name: Setup Node.js
# actions/setup-node@v4
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
with:
node-version: '22.21.1'
cache: 'npm'
- name: Install Node dependencies
run: npm ci --ignore-scripts
- name: Regenerate tool docs
run: npx tsx scripts/generate-tool-docs.ts
- name: Check for tool-docs drift
run: |
if ! git diff --exit-code -- docs/tools/ || [ -n "$(git ls-files --others --exclude-standard -- docs/tools/)" ]; then
echo "::error::docs/tools/ is out of sync with tools/registry.ts. Run 'make tools-docs' and commit the result."
git status --porcelain -- docs/tools/
exit 1
fi
- name: Check skill catalog sync
run: npm run check:skill-sync
- name: Set up Python
# actions/setup-python@v5
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
with:
python-version: "3.12"
cache: "pip"
cache-dependency-path: requirements-docs.txt
- name: Install docs dependencies
run: pip install -r requirements-docs.txt
- name: Build site (strict)
run: mkdocs build --strict