Skip to content

Commit

Permalink
Merge branch 'any'
Browse files Browse the repository at this point in the history
  • Loading branch information
NMSAzulX committed Nov 13, 2024
2 parents 069366b + 31cadf7 commit 580008d
Show file tree
Hide file tree
Showing 15 changed files with 143 additions and 69 deletions.
2 changes: 1 addition & 1 deletion .github/NMS_TEMPLATE/test.yml.template
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
6.0.x
8.0.x
9.0.x

${{nms.tests}}

- name: Publish Test Results
Expand Down
80 changes: 69 additions & 11 deletions .github/project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ ignore_projects:
- test/ut/PluginLibraries/Plugin2/Plugin2.csproj
- test/ut/PluginLibraries/PluginBase/PluginBase.csproj
- test/ut/PluginFunctionUT/PluginFunctionUT.csproj
- test/ut/Plugin/Domain/Domain.csproj
- test/ut/Natasha.CSharp.UnitTest.Base/Natasha.CSharp.UnitTest.Base.csproj
issues_template_configs:
- panel_name: " \U0001F41E 上报 BUG (Report bug)"
file_name: bug
Expand Down Expand Up @@ -89,10 +91,14 @@ samples:
- samples/PluginSample/PluginA/PluginA.csproj
- samples/PluginSample/PluginB/PluginB.csproj
- samples/PluginSample/PluginBase/PluginBase.csproj
- samples/ReferenceSample/ReferenceSample.csproj
- samples/HotReloadSample/HotReloadSample.csproj
- samples/HotReloadPlugin/HotReloadPlugin.csproj
- samples/ExtensionSample/ExtensionSample.csproj
- samples/DebugSample/DebugSample.csproj
- samples/AllProxySample/AllProxySample.csproj
- samples/HE/NET5.0/ConsoleSample/ConsoleSample.csproj
- samples/HE/NET6.0/WebapiSample/WebapiSample.csproj
- samples/HE/NET5.0/WinFormsSample/WinFormsSample.csproj
- samples/HE/NET6.0/WebapiWIthController/WebapiWIthController.csproj
- samples/HE/NETCORE3.0/ConsoleSample/ConsoleSample.csproj
global_labels:
- name: pr_samples
description: 此次提交包含 [案例工程] 相关的改动.
Expand Down Expand Up @@ -196,6 +202,46 @@ src:
project_folder: src/Natasha.CSharp/Component/Core/Natasha.CSharp.Template.Core
labels:
dependency_config:
- using_output:
enable: true
ignores:
- System
- System.Runtime.CompilerServices
- System.Reflection
id: 1F76ECC0-ABD3-4828-87CD-BE4AEEA4FB66
is_ignored: false
is_folded: false
relative_path: src/Natasha.CSharp/Extension/HotExecutor/Natasha.CSharp.HotExecutor/Natasha.CSharp.HotExecutor.csproj
project_name: Natasha.CSharp.HotExecutor
package_name: DotNetCore.Natasha.CSharp.Extension.HotReload
project_folder: src/Natasha.CSharp/Extension/HotExecutor/Natasha.CSharp.HotExecutor
labels:
dependency_config:
- using_output:
id: F1B47923-B3CB-446A-8D52-D8075E65B5F8
is_ignored: false
is_folded: false
relative_path: src/Natasha.CSharp/Extension/Natasha.CSharp.Extension.CompileDirector/Natasha.CSharp.Extension.CompileDirector.csproj
project_name: Natasha.CSharp.Extension.CompileDirector
package_name: DotNetCore.Natasha.CSharp.Extension.CompileDirector
project_folder: src/Natasha.CSharp/Extension/Natasha.CSharp.Extension.CompileDirector
labels:
dependency_config:
- using_output:
enable: true
ignores:
- System
- System.Runtime.CompilerServices
- System.Reflection
id: 39456A90-01B8-4749-B1C7-B1F3082F2466
is_ignored: false
is_folded: false
relative_path: src/Natasha.CSharp/Extension/HotExecutor/Natasha.CSharp.HotExecutor.SG/Natasha.CSharp.HotExecutor.SG.csproj
project_name: Natasha.CSharp.HotExecutor.SG
package_name: DotNetCore.Natasha.CSharp.Extension.HotReload.SG
project_folder: src/Natasha.CSharp/Extension/HotExecutor/Natasha.CSharp.HotExecutor.SG
labels:
dependency_config:
test:
folded_projects: []
global_labels:
Expand All @@ -206,25 +252,37 @@ test:
- trigger_pull_request_test: false
trigger_codecov: false
o_s:
id: 7EC1DFB6-3332-4A4D-867B-B7C32D2AB0FE
id: 767438D7-594D-4C59-9C2F-5B7233D5F841
is_ignored: false
is_folded: false
relative_path: test/ut/NatashaFunctionUT/NatashaFunctionUT.csproj
project_name: NatashaFunctionUT
relative_path: test/ut/Plugin/Compile/Compile.csproj
project_name: Compile
package_name:
project_folder: test/ut/NatashaFunctionUT
project_folder: test/ut/Plugin/Compile
labels:
dependency_config:
- trigger_pull_request_test: true
trigger_codecov: true
o_s: linux
id: C4427931-E3B0-47DC-B0B8-26D4E4AC1D2E
id: 67BBDAD5-AFE1-4371-A5CA-C05242A28542
is_ignored: false
is_folded: false
relative_path: test/ut/Compile/RefAssembly/RefAssembly.csproj
project_name: RefAssembly
package_name:
project_folder: test/ut/Compile/RefAssembly
labels:
dependency_config:
- trigger_pull_request_test: true
trigger_codecov: false
o_s:
id: AC2E37E8-A930-4092-BA9D-2CCC2E895E5D
is_ignored: false
is_folded: false
relative_path: test/ut/CompileUnit/RefAssemblyUT/RefAssemblyUT.csproj
project_name: RefAssemblyUT
relative_path: test/ut/Compile/MemAssembly/MemAssembly.csproj
project_name: MemAssembly
package_name:
project_folder: test/ut/CompileUnit/RefAssemblyUT
project_folder: test/ut/Compile/MemAssembly
labels:
dependency_config:
workflow:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: 🚦 Check & Pack Codecov - RefAssemblyUT
run: dotnet test "./test/ut/CompileUnit/RefAssemblyUT/RefAssemblyUT.csproj" --nologo -f net6.0 -c Release --collect:"XPlat Code Coverage" --results-directory "./coverage/"
- name: 🚦 Check & Pack Codecov - RefAssembly
run: dotnet test "./test/ut/Compile/RefAssembly/RefAssembly.csproj" --nologo -f net6.0 -c Release --collect:"XPlat Code Coverage" --results-directory "./coverage/"


- name: 📶 Push to Codecov
if: ${{ needs.prepare.outputs.hasCoverageKey == 'true' }}
uses: codecov/codecov-action@v4.3.0
uses: codecov/codecov-action@v4.5.0
with:
token: ${{ secrets.COVERAGE_KEY }}
directory: ./coverage/
Expand Down
17 changes: 10 additions & 7 deletions .github/workflows/pr_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,40 +25,43 @@ jobs:
3.1.x
6.0.x
8.0.x
9.0.x
- name: 👀 Test & Pack Codecov - RefAssemblyUT
run: dotnet test "./test/ut/CompileUnit/RefAssemblyUT/RefAssemblyUT.csproj" --nologo -f net6.0 -c Release -l "trx;LogFileName=RefAssemblyUT.trx" --results-directory "TestResults" --collect:"XPlat Code Coverage"
- name: 👀 Test & Pack Codecov - RefAssembly
run: dotnet test "./test/ut/Compile/RefAssembly/RefAssembly.csproj" --nologo -f net6.0 -c Release -l "trx;LogFileName=RefAssembly.trx" --results-directory "TestResults" --collect:"XPlat Code Coverage"
- name: 📶 Push to Codecov
if: matrix.os == 'ubuntu-latest'
uses: codecov/[email protected]
with:
token: ${{ secrets.COVERAGE_KEY }}
directory: TestResults
- name: 🚦 RefAssemblyUT UT Test Not on ubuntu-latest
- name: 🚦 RefAssembly UT Test Not on ubuntu-latest
if: matrix.os != 'ubuntu-latest'
run: dotnet test './test/ut/CompileUnit/RefAssemblyUT' --nologo -c Release -l "trx;LogFileName=RefAssemblyUT.trx" --results-directory "TestResults"
run: dotnet test './test/ut/Compile/RefAssembly' --nologo -c Release -l "trx;LogFileName=RefAssembly.trx" --results-directory "TestResults"

- name: 🚦 MemAssembly UT Test
run: dotnet test './test/ut/Compile/MemAssembly' --nologo -c Release -l "trx;LogFileName=MemAssembly.trx" --results-directory "TestResults"


- name: Publish Test Results
if: matrix.os == 'ubuntu-latest'
uses: EnricoMi/publish-unit-test-result-action@v2
uses: EnricoMi/publish-unit-test-result-action/linux@v2
with:
check_name: 'UT Test - Ubuntu'
files: |
TestResults/**/*.trx
# - name: Publish Test Results
# if: matrix.os == 'macos-latest'
# uses: EnricoMi/publish-unit-test-result-action/composite@v2
# uses: EnricoMi/publish-unit-test-result-action/macos@v2
# with:
# check_name: 'UT Test - Macos'
# files: |
# TestResults/**/*.trx

- name: Publish Test Results
if: matrix.os == 'windows-latest'
uses: EnricoMi/publish-unit-test-result-action/composite@v2
uses: EnricoMi/publish-unit-test-result-action/windows@v2
with:
check_name: 'UT Test - Windows'
files: |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
Expand Down Expand Up @@ -28,4 +28,9 @@
</ItemGroup>


<ItemGroup>
<None Include="Targets\Project.Usings.targets" Pack="true" PackagePath="build\netstandard2.1\DotNetCore.Natasha.CSharp.Extension.HotReload.SG.targets" />
<None Include="Targets\Project.Usings.targets" Pack="true" PackagePath="buildTransitive\netstandard2.1\DotNetCore.Natasha.CSharp.Extension.HotReload.SG.targets" />
<None Include="Targets\Project.Usings.targets" Pack="true" PackagePath="buildMultiTargeting\netstandard2.1\DotNetCore.Natasha.CSharp.Extension.HotReload.SG.targets" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<Project>
<ItemGroup Condition="'$(ImplicitUsings)' == 'enable' or '$(ImplicitUsings)' == 'true'">
<Using Include="Natasha.CSharp.Extension.HotExecutor.SG" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.1;</TargetFrameworks>
Expand All @@ -18,4 +18,9 @@
<ProjectReference Include="..\..\..\Natasha.CSharp.Compiler\Natasha.CSharp.Compiler.csproj" />
</ItemGroup>

<ItemGroup>
<None Include="Targets\Project.Usings.targets" Pack="true" PackagePath="build\netstandard2.1\DotNetCore.Natasha.CSharp.Extension.HotReload.targets" />
<None Include="Targets\Project.Usings.targets" Pack="true" PackagePath="buildTransitive\netstandard2.1\DotNetCore.Natasha.CSharp.Extension.HotReload.targets" />
<None Include="Targets\Project.Usings.targets" Pack="true" PackagePath="buildMultiTargeting\netstandard2.1\DotNetCore.Natasha.CSharp.Extension.HotReload.targets" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Project>
<ItemGroup Condition="'$(ImplicitUsings)' == 'enable' or '$(ImplicitUsings)' == 'true'">
<Using Include="Natasha.CSharp.Extension.HotExecutor" />
<Using Include="Natasha.CSharp.HotExecutor.Component" />
<Using Include="Natasha.CSharp.HotExecutor.Component.SyntaxUtils" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -79,19 +79,9 @@ public void CompileWithoutAssembly()
Stopwatch stopwatch = new();
stopwatch.Start();
#endif
Stream dllStream;
Stream? pdbStream = null;
using Stream dllStream = DllFilePath != string.Empty ? File.Create(FileHandle(DllFilePath)) : new MemoryStream();
Stream ? pdbStream = null;
Stream? xmlStream = null;
if (DllFilePath != string.Empty)
{
dllStream = File.Create(FileHandle(DllFilePath));

}
else
{
dllStream = new MemoryStream();
}

if (CommentFilePath != string.Empty)
{
xmlStream = File.Create(FileHandle(CommentFilePath));
Expand Down Expand Up @@ -293,16 +283,14 @@ public Assembly GetAssembly()
if (compileResult.Success)
{
dllStream.Position = 0;
pdbStream?.Dispose();
assembly = Domain.LoadAssemblyFromStream(dllStream, null);
LoadContext!.LoadMetadataWithAssembly(assembly);
CompileSucceedEvent?.Invoke(_compilation, assembly!);
dllStream.Dispose();
pdbStream?.Dispose();
xmlStream?.Dispose();
}
else
{
dllStream.Dispose();
pdbStream?.Dispose();
xmlStream?.Dispose();
CompileFailedEvent?.Invoke(_compilation, compileResult.Diagnostics);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
<ItemGroup Condition="'$(ImplicitUsings)' == 'enable' or '$(ImplicitUsings)' == 'true'">
<Using Include="Natasha.CSharp" />
<Using Include="Natasha.CSharp.Reverser" />
<Using Include="Natasha.CSharp.Compiler.Utils" />
<Using Include="System.Runtime.CompilerServices
//" />
<Using Include="Natasha.CSharp.Compiler.Component" />
<Using Include="Natasha.CSharp.Compiler" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion test/workflow/Github.NET.Sdk/Model/GithubLabel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
public class GithubLabelBase
{
public string Title { get; set; } = string.Empty;
public string Name { get; set; } = string.Empty;
public string? Description { get; set; }
public string Color { get; set; } = string.Empty;
}
Expand Down
Loading

0 comments on commit 580008d

Please sign in to comment.