Skip to content

Commit 0e7f88b

Browse files
zzz123456789-dev蚂蚁
andauthored
工作流问题修复 (#88)
* 工作流run test添加日志 * 工作流run test添加日志 * 工作流test * chore(ci): 添加测试目录结构检查 - 安装 tree 工具用于检查目录结构 - 在 JavaScript 和 Python 测试前添加目录检查步骤 * chore(ci): 更新测试目录深度和测试输出处理 - 将测试目录检查深度从3改为4 - 移除JavaScript测试中的`|| true`,使测试失败能被捕获 * fix: 修复 prepare-js-benchmark 中的文件移动逻辑 - 添加日志记录 srcPath 存在情况 - 启用覆盖选项确保文件移动成功 * fix(ci): 更新测试日志匹配规则 - 调整各语言测试的日志匹配字符串 - 修改javascript测试文件处理逻辑 * fix(ci): 修复 Java 测试失败时继续执行 refactor(test): 移除 prepare-js-benchmark 中的冗余日志 * fix(test): remove duplicate test case in sast-java-expect.result * fix(workflow): 修复java测试日志输出问题 - 移除`|| true`以避免错误被忽略 - 确保测试失败时工作流正确终止 * fix(workflow): 允许go测试失败继续执行 * chore(workflow): 移除冗余的benchmark检查步骤 - 删除重复的tree命令检查 - 添加deps目录检查步骤 * chore(workflow): 简化 release 工作流中的 tree 命令 - 将 `tree deps` 改为 `tree -L 3` 以限制目录深度 * feat(workflow): 添加 UAST 二进制部署步骤 - 下载并解压 UAST 二进制文件 - 部署 Linux 版本的 go 和 python 二进制到 deps 目录 - 添加可执行权限并验证部署结果 * chore(workflow): 移除不必要的安装和检查步骤 - 删除 `Install tree` 步骤 - 删除 `Check UAST Release Assets` 步骤 * chore(workflow): 更新 release action 变量 - 将 `github.ref` 替换为 `github.ref_name` - 保持发布名称和标签一致 * fix(ci): 修复go测试日志输出问题 - 移除测试失败时的`|| true`,确保测试失败时流程终止 * chore(workflow): 更新 release 工作流中的 tag 和 name 变量 - 使用 `github.ref` 替代 `github.ref_name` 以获取完整引用路径 - 保持 release 名称与 tag 一致 --------- Co-authored-by: 蚂蚁 <mayi@mayideMacBook-Pro.local>
1 parent 90fe3ee commit 0e7f88b

File tree

3 files changed

+128
-107
lines changed

3 files changed

+128
-107
lines changed

.github/workflows/release.yml

Lines changed: 43 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ jobs:
170170
echo "Running JavaScript tests..."
171171
npm run test-js > test-js-output.log 2>&1
172172
cat test-js-output.log
173-
if grep -q "------------- 1: taint_flow_test-------------" test-js-output.log; then
173+
if grep -q -- "------------- 1: taint_flow_test-------------" test-js-output.log; then
174174
echo "✅ JavaScript tests passed"
175175
echo "js_result=success" >> $GITHUB_OUTPUT
176176
else
@@ -184,21 +184,60 @@ jobs:
184184
echo "Running Java tests..."
185185
npm run test-java > test-java-output.log 2>&1
186186
cat test-java-output.log
187-
if grep -q "------------- 1: taint_flow_test-------------" test-java-output.log; then
187+
if grep -q -- "------------- 1 : taint_flow_java_input_inner -------------" test-java-output.log; then
188188
echo "✅ Java tests passed"
189189
echo "java_result=success" >> $GITHUB_OUTPUT
190190
else
191191
echo "❌ Java tests failed"
192192
echo "java_result=failure" >> $GITHUB_OUTPUT
193193
fi
194194
195+
- name: Download UAST binaries
196+
uses: actions/download-artifact@v4
197+
with:
198+
name: uast-binaries
199+
path: uast_binaries/
200+
201+
- name: Extract and Deploy Linux Binaries to deps/
202+
run: |
203+
# 创建目标目录
204+
mkdir -p deps/uast4go deps/uast4py
205+
206+
# 查找 linux-amd64 或 linux-x86_64 的 go 和 python 二进制
207+
GO_BINARY=$(find uast_binaries -name "uast4go-*linux*-amd64" -o -name "uast4go-*linux*-x86_64" | head -n1)
208+
PY_BINARY=$(find uast_binaries -name "uast4py-*linux*-amd64" -o -name "uast4py-*linux*-x86_64" | head -n1)
209+
210+
if [ ! -f "$GO_BINARY" ]; then
211+
echo "❌ Cannot find uast4go Linux binary in uast_binaries/"
212+
ls -lh uast_binaries/
213+
exit 1
214+
fi
215+
216+
if [ ! -f "$PY_BINARY" ]; then
217+
echo "❌ Cannot find uast4py Linux binary in uast_binaries/"
218+
ls -lh uast_binaries/
219+
exit 1
220+
fi
221+
222+
# 复制并重命名为无平台后缀的名称
223+
cp "$GO_BINARY" deps/uast4go/uast4go
224+
cp "$PY_BINARY" deps/uast4py/uast4py
225+
226+
# 添加可执行权限
227+
chmod +x deps/uast4go/uast4go
228+
chmod +x deps/uast4py/uast4py
229+
230+
echo "✅ Deployed:"
231+
echo " $GO_BINARY --> deps/uast4go/uast4go"
232+
echo " $PY_BINARY --> deps/uast4py/uast4py"
233+
195234
- name: 🧪 Run Go Tests
196235
id: test_go
197236
run: |
198237
echo "Running Go tests..."
199238
npm run test-go > test-go-output.log 2>&1
200239
cat test-go-output.log
201-
if grep -q "------------- 1: taint_flow_test-------------" test-go-output.log; then
240+
if grep -q -- "------------- 1: taint_flow_test-------------" test-go-output.log; then
202241
echo "✅ Go tests passed"
203242
echo "go_result=success" >> $GITHUB_OUTPUT
204243
else
@@ -212,7 +251,7 @@ jobs:
212251
echo "Running Python tests..."
213252
npm run test-python > test-python-output.log 2>&1
214253
cat test-python-output.log
215-
if grep -q "------------- 1: taint_flow_test-------------" test-python-output.log; then
254+
if grep -q -- "------------- 1: taint_flow_test-------------" test-python-output.log; then
216255
echo "✅ Python tests passed"
217256
echo "python_result=success" >> $GITHUB_OUTPUT
218257
else

0 commit comments

Comments
 (0)