1+ name : CI Pipeline
2+
3+ on :
4+ push :
5+ branches : [ main ]
6+ pull_request :
7+ branches : [ main ]
8+ workflow_dispatch :
9+
10+ env :
11+ NODE_VERSION : ' 20'
12+
13+ jobs :
14+ test :
15+ name : Test Weather MCP Server
16+ runs-on : ubuntu-latest
17+
18+ steps :
19+ - name : Checkout code
20+ uses : actions/checkout@v4
21+
22+ - name : Setup Node.js
23+ uses : actions/setup-node@v4
24+ with :
25+ node-version : ${{ env.NODE_VERSION }}
26+ cache : ' npm'
27+
28+ - name : Install dependencies
29+ run : npm install
30+
31+ - name : Test make build
32+ run : |
33+ echo "🏗️ Testing make build..."
34+ make build
35+
36+ # Verify build output exists
37+ if [ ! -f build/index.js ]; then
38+ echo "❌ build/index.js not found"
39+ exit 1
40+ fi
41+ echo "✅ make build successful"
42+
43+ - name : Test make test-stdio
44+ run : |
45+ echo "🔌 Testing make test-stdio..."
46+ make test-stdio
47+ echo "✅ make test-stdio successful"
48+
49+ - name : Test make pack and verify contents
50+ run : |
51+ echo "📦 Testing make pack..."
52+ make pack
53+
54+ # Check that DXT file was created
55+ if [ ! -f weather-mcp.dxt ]; then
56+ echo "❌ weather-mcp.dxt not found"
57+ exit 1
58+ fi
59+
60+ # Install unzip if not available (should be available in ubuntu-latest)
61+ if ! command -v unzip &> /dev/null; then
62+ echo "Installing unzip..."
63+ sudo apt-get update && sudo apt-get install -y unzip
64+ fi
65+
66+ # Extract the package using unzip
67+ echo "📂 Extracting package with unzip..."
68+ mkdir -p test-extract
69+ unzip -q weather-mcp.dxt -d test-extract
70+
71+ # Show extracted contents for debugging
72+ echo "📁 Extracted contents:"
73+ find test-extract -type f | head -20
74+
75+ # Verify required files exist
76+ echo "🔍 Verifying package contents..."
77+
78+ if [ ! -d test-extract/build ]; then
79+ echo "❌ build/ directory missing"
80+ ls -la test-extract/
81+ exit 1
82+ fi
83+ echo "✅ build/ directory found"
84+
85+ if [ ! -d test-extract/node_modules ]; then
86+ echo "❌ node_modules/ directory missing"
87+ ls -la test-extract/
88+ exit 1
89+ fi
90+ echo "✅ node_modules/ directory found"
91+
92+ if [ ! -f test-extract/package.json ]; then
93+ echo "❌ package.json missing"
94+ ls -la test-extract/
95+ exit 1
96+ fi
97+ echo "✅ package.json found"
98+
99+ if [ ! -f test-extract/package-lock.json ]; then
100+ echo "❌ package-lock.json missing"
101+ ls -la test-extract/
102+ exit 1
103+ fi
104+ echo "✅ package-lock.json found"
105+
106+ if [ ! -f test-extract/manifest.json ]; then
107+ echo "❌ manifest.json missing"
108+ ls -la test-extract/
109+ exit 1
110+ fi
111+ echo "✅ manifest.json found"
112+
113+ echo "✅ make pack successful - all required files present"
114+
115+ - name : Setup Docker Buildx
116+ uses : docker/setup-buildx-action@v3
117+
118+ - name : Test image.sh build
119+ run : |
120+ echo "🐳 Testing image.sh build..."
121+
122+ # Make script executable
123+ chmod +x image.sh
124+
125+ # Run the build
126+ ./image.sh build
127+
128+ # Verify image was created
129+ if ! docker images | grep -q "quay.io/atarazana/weather-mcp"; then
130+ echo "❌ Container image not found"
131+ docker images
132+ exit 1
133+ fi
134+
135+ echo "✅ image.sh build successful"
136+
137+ - name : Upload artifacts
138+ if : always()
139+ uses : actions/upload-artifact@v4
140+ with :
141+ name : build-artifacts
142+ path : |
143+ weather-mcp.dxt
144+ build/
145+ retention-days : 7
0 commit comments