Skip to content

Commit 6e139ea

Browse files
临时验证CI
1 parent d4126d3 commit 6e139ea

File tree

1 file changed

+44
-44
lines changed

1 file changed

+44
-44
lines changed

.github/workflows/Build&Test.yml

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -79,64 +79,64 @@ jobs:
7979
echo "-p version=$BuildVersion" | out-file NuGet\metadata.txt -Append
8080
}
8181
82-
echo '-p "commit=$env:GITHUB_SHA"' | out-file NuGet\metadata.txt -Append
82+
echo "-p commit=$env:GITHUB_SHA" | out-file NuGet\metadata.txt -Append
8383
84-
- name: 执行单元测试
85-
if: contains(github.ref, 'tags/') != 'true'
86-
working-directory: ${{env.GITHUB_WORKSPACE}}
87-
shell: pwsh
88-
run: |
89-
# Procdump工具,用于单元测试崩溃诊断
90-
Invoke-WebRequest -Uri https://download.sysinternals.com/files/Procdump.zip -OutFile Bin\Procdump.zip
91-
&7z e Bin\Procdump.zip "-o$Env:GITHUB_WORKSPACE\Bin"
84+
# - name: 执行单元测试
85+
# if: contains(github.ref, 'tags/') != 'true'
86+
# working-directory: ${{env.GITHUB_WORKSPACE}}
87+
# shell: pwsh
88+
# run: |
89+
# # Procdump工具,用于单元测试崩溃诊断
90+
# Invoke-WebRequest -Uri https://download.sysinternals.com/files/Procdump.zip -OutFile Bin\Procdump.zip
91+
# &7z e Bin\Procdump.zip "-o$Env:GITHUB_WORKSPACE\Bin"
9292

93-
# MSBuild、PROCDUMP_PATH目录更新到 Path
94-
$Env:Path="$Env:GITHUB_WORKSPACE\Bin;${{env.MSBuildBinPath}};${{env.LatestVisualStudioRoot}}\Common7\IDE\CommonExtensions\Microsoft\TestWindow;" + $Env:Path
93+
# # MSBuild、PROCDUMP_PATH目录更新到 Path
94+
# $Env:Path="$Env:GITHUB_WORKSPACE\Bin;${{env.MSBuildBinPath}};${{env.LatestVisualStudioRoot}}\Common7\IDE\CommonExtensions\Microsoft\TestWindow;" + $Env:Path
9595

96-
# 编译单元测试项目
97-
&msbuild UnitTest\UnitTest.vcxproj "-p:Configuration=Release;Platform=Win32;SolutionDir=$Env:GITHUB_WORKSPACE\\"
98-
if($lastexitcode -ne 0)
99-
{
100-
throw "UnitTest\UnitTest.vcxproj 编译失败!退出代码:$lastexitcode"
101-
}
96+
# # 编译单元测试项目
97+
# &msbuild UnitTest\UnitTest.vcxproj "-p:Configuration=Release;Platform=Win32;SolutionDir=$Env:GITHUB_WORKSPACE\\"
98+
# if($lastexitcode -ne 0)
99+
# {
100+
# throw "UnitTest\UnitTest.vcxproj 编译失败!退出代码:$lastexitcode"
101+
# }
102102

103-
&msbuild UnitTest\UnitTest.vcxproj "-p:Configuration=Release;Platform=x64;SolutionDir=$Env:GITHUB_WORKSPACE\\"
104-
if($lastexitcode -ne 0)
105-
{
106-
throw "UnitTest\UnitTest.vcxproj 编译失败!退出代码:$lastexitcode"
107-
}
103+
# &msbuild UnitTest\UnitTest.vcxproj "-p:Configuration=Release;Platform=x64;SolutionDir=$Env:GITHUB_WORKSPACE\\"
104+
# if($lastexitcode -ne 0)
105+
# {
106+
# throw "UnitTest\UnitTest.vcxproj 编译失败!退出代码:$lastexitcode"
107+
# }
108108

109-
$RunFaild = 0
109+
# $RunFaild = 0
110110

111-
&vstest.console Release\UnitTest.dll "/logger:trx;LogFileName=UnitTestWin32.trx" "/Blame:CollectDump;CollectAlways=false;DumpType=full" "/Diag:TestResults\Win32.log"
112-
if($lastexitcode -ne 0)
113-
{
114-
$RunFaild = 1
115-
}
111+
# &vstest.console Release\UnitTest.dll "/logger:trx;LogFileName=UnitTestWin32.trx" "/Blame:CollectDump;CollectAlways=false;DumpType=full" "/Diag:TestResults\Win32.log"
112+
# if($lastexitcode -ne 0)
113+
# {
114+
# $RunFaild = 1
115+
# }
116116

117-
&vstest.console x64\Release\UnitTest.dll "/logger:trx;LogFileName=UnitTestWin64.trx" "/Blame:CollectDump;CollectAlways=false;DumpType=full" "/Diag:TestResults\Win64.log"
118-
if($lastexitcode -ne 0)
119-
{
120-
$RunFaild = 1
121-
}
117+
# &vstest.console x64\Release\UnitTest.dll "/logger:trx;LogFileName=UnitTestWin64.trx" "/Blame:CollectDump;CollectAlways=false;DumpType=full" "/Diag:TestResults\Win64.log"
118+
# if($lastexitcode -ne 0)
119+
# {
120+
# $RunFaild = 1
121+
# }
122122

123-
if($RunFaild -ne 0)
124-
{
125-
throw "单元测试失败!"
126-
}
127-
- uses: dorny/test-reporter@v1
128-
if: contains(fromJSON('["push", "create"]'), github.event_name) && contains(github.ref, 'tags/') != 'true' && (success() || failure())
129-
with:
130-
name: 单元测试报告
131-
path: TestResults/*.trx
132-
reporter: dotnet-trx
123+
# if($RunFaild -ne 0)
124+
# {
125+
# throw "单元测试失败!"
126+
# }
127+
# - uses: dorny/test-reporter@v1
128+
# if: contains(fromJSON('["push", "create"]'), github.event_name) && contains(github.ref, 'tags/') != 'true' && (success() || failure())
129+
# with:
130+
# name: 单元测试报告
131+
# path: TestResults/*.trx
132+
# reporter: dotnet-trx
133133

134134
- name: 文件打包
135135
working-directory: ${{env.GITHUB_WORKSPACE}}
136136
shell: cmd
137137
run: |
138138
::打包Nuget
139-
nuget pack NuGet\YY.Base.nuspec "@.\NuGet\metadata.txt"
139+
nuget pack NuGet\YY.Base.nuspec -p "Channel=CI" "@.\NuGet\metadata.txt"
140140
141141
- uses: actions/upload-artifact@v4
142142
with:

0 commit comments

Comments
 (0)