Skip to content

Commit 76e1242

Browse files
committed
Revert "enhance build verification and error handling in CI pipeline"
This reverts commit eb22cec.
1 parent cf57b50 commit 76e1242

File tree

1 file changed

+5
-76
lines changed

1 file changed

+5
-76
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -213,38 +213,6 @@ jobs:
213213
--no-retry \
214214
--verbose
215215
216-
BUILD_EXIT_CODE=$?
217-
echo "Build exit code: $BUILD_EXIT_CODE"
218-
219-
if [ $BUILD_EXIT_CODE -ne 0 ]; then
220-
echo "❌ Build failed with exit code $BUILD_EXIT_CODE"
221-
exit $BUILD_EXIT_CODE
222-
fi
223-
224-
# 验证构建产物
225-
echo -e "\n=== Verifying build output ==="
226-
if [ -f "build/Release/wsjtx_lib_nodejs.node" ]; then
227-
echo "✅ Native module created: build/Release/wsjtx_lib_nodejs.node"
228-
ls -lh build/Release/wsjtx_lib_nodejs.node
229-
230-
FILE_SIZE=$(stat -c%s "build/Release/wsjtx_lib_nodejs.node")
231-
echo "File size: $FILE_SIZE bytes"
232-
233-
if [ "$FILE_SIZE" -lt 10000 ]; then
234-
echo "❌ ERROR: Built file is too small ($FILE_SIZE bytes)!"
235-
echo "This indicates a build failure that wasn't caught."
236-
exit 1
237-
fi
238-
239-
echo "File type:"
240-
file build/Release/wsjtx_lib_nodejs.node || true
241-
else
242-
echo "❌ ERROR: Native module not found after build!"
243-
echo "Build directory contents:"
244-
find build -type f || true
245-
exit 1
246-
fi
247-
248216
# 10. 运行测试 - Linux/macOS
249217
- name: Run tests (Linux/macOS)
250218
if: runner.os != 'Windows'
@@ -291,65 +259,26 @@ jobs:
291259
run: |
292260
echo "📁 Checking test environment..."
293261
294-
# 检查测试文件
262+
# 检查测试文件和原生模块
295263
if [ ! -f "dist/test/wsjtx.basic.test.js" ]; then
296264
echo "❌ Test file not found!"
297265
find dist -name "*.test.js" -type f || echo "No test files found"
298266
exit 1
299267
fi
300-
echo "✅ Test file: dist/test/wsjtx.basic.test.js"
301268
302-
# 检查原生模块是否存在
303269
if [ ! -f "build/Release/wsjtx_lib_nodejs.node" ]; then
304-
echo "❌ Native module not found at build/Release/"
305-
echo "🔍 Searching for .node files..."
270+
echo "❌ Native module not found!"
306271
find . -name "*.node" -type f || echo "No .node files found"
307272
exit 1
308273
fi
309274
310-
# 验证原生模块文件
311-
NODE_FILE="build/Release/wsjtx_lib_nodejs.node"
312-
echo "✅ Native module found: $NODE_FILE"
313-
314-
# 检查文件大小
315-
FILE_SIZE=$(stat -c%s "$NODE_FILE" 2>/dev/null || echo "0")
316-
echo "📊 File size: $FILE_SIZE bytes"
317-
318-
if [ "$FILE_SIZE" -lt 10000 ]; then
319-
echo "❌ ERROR: File size too small ($FILE_SIZE bytes), likely a build failure!"
320-
echo "🔍 File details:"
321-
ls -lh "$NODE_FILE"
322-
echo "🔍 File type:"
323-
file "$NODE_FILE" || true
324-
echo "🔍 Checking build log for errors..."
325-
exit 1
326-
fi
327-
328-
# 检查文件类型
329-
echo "🔍 File type check:"
330-
file "$NODE_FILE" || true
331-
332-
# 检查 DLL 依赖
333-
echo ""
334-
echo "🔍 DLL dependencies:"
335-
objdump -p "$NODE_FILE" | grep "DLL Name" || echo "Cannot check DLL dependencies"
275+
echo "✅ Test file: dist/test/wsjtx.basic.test.js"
276+
echo "✅ Native module: build/Release/wsjtx_lib_nodejs.node"
336277
337278
# 设置库路径
338-
echo ""
339-
echo "🔧 Setting up environment..."
340279
export PATH="/mingw64/bin:$PATH"
341280
export LD_LIBRARY_PATH="/mingw64/lib:$LD_LIBRARY_PATH"
342281
343-
# 验证关键 DLL 是否存在
344-
echo "🔍 Checking critical DLLs..."
345-
for dll in libfftw3f-3.dll libgfortran-5.dll libgcc_s_seh-1.dll; do
346-
if [ -f "/mingw64/bin/$dll" ]; then
347-
echo " ✅ $dll"
348-
else
349-
echo " ❌ $dll NOT FOUND"
350-
fi
351-
done
352-
353282
# 运行测试
354283
echo ""
355284
echo "🧪 Running tests..."
@@ -358,7 +287,7 @@ jobs:
358287
else
359288
echo "❌ Test failed"
360289
echo "🔍 Attempting direct module load..."
361-
node -e "try { require('./build/Release/wsjtx_lib_nodejs.node'); console.log('✅ Module loads OK'); } catch(e) { console.error('❌ Error:', e.message); console.error('Stack:', e.stack); }"
290+
node -e "try { require('./build/Release/wsjtx_lib_nodejs.node'); console.log('✅ Module loads OK'); } catch(e) { console.error('❌ Error:', e.message); }"
362291
exit 1
363292
fi
364293

0 commit comments

Comments
 (0)