From f67a43f159534d2b40055cb005c46c9e019d4f69 Mon Sep 17 00:00:00 2001 From: PuqiAR Date: Sat, 3 Jan 2026 22:03:24 +0800 Subject: [PATCH] =?UTF-8?q?[CI]=20Windows=E5=B7=A5=E5=85=B7=E9=93=BE?= =?UTF-8?q?=E9=AA=8C=E8=AF=81=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/build.yml | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 0ef800f..6637b17 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -110,13 +110,34 @@ jobs: steps: - name: 验证Windows工具链 run: | - # 检查 xmake 和 clang 是否在 PATH 中 - where xmake || echo "警告: xmake 未找到" - where clang++ || echo "警告: clang++ 未找到" - # 显示版本信息 - if (Get-Command xmake -ErrorAction SilentlyContinue) { xmake --version } - if (Get-Command clang++ -ErrorAction SilentlyContinue) { clang++ --version } - + # 设置当前 PowerShell 会话的执行策略 + powershell -Command "Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process -Force" + + # 使用 PowerShell 语法检查工具链 + powershell -Command " + # 检查 xmake + if (Get-Command xmake -ErrorAction SilentlyContinue) { + Write-Host '✅ xmake 已安装' + xmake --version + } else { + Write-Host '警告: xmake 未找到' + } + + # 检查 clang++ + if (Get-Command clang++ -ErrorAction SilentlyContinue) { + Write-Host '✅ clang++ 已安装' + clang++ --version + } else { + Write-Host '警告: clang++ 未找到' + } + + # 检查 git(可选) + if (Get-Command git -ErrorAction SilentlyContinue) { + Write-Host '✅ git 已安装' + } else { + Write-Host '警告: git 未找到' + } + " - name: 检出代码 run: | git clone https://git.fig-lang.cn/${{ github.repository }} .