Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI重建 #369

Merged
merged 2 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/NMS_TEMPLATE/codecov.yml.template
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ ${{nms.codecov}}

- 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
1 change: 1 addition & 0 deletions .github/NMS_TEMPLATE/test.yml.template
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
3.1.x
6.0.x
8.0.x
9.0.x

${{nms.tests}}

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
7 changes: 0 additions & 7 deletions Natasha.sln
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RefAssembly", "test\ut\Comp
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MemAssembly", "test\ut\Compile\MemAssembly\MemAssembly.csproj", "{AC2E37E8-A930-4092-BA9D-2CCC2E895E5D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NatashaFunctionUT", "test\ut\Extension\Extension\NatashaFunctionUT.csproj", "{282B1CCD-6C93-442E-B2E7-FD4BB73EC85A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Natasha.CSharp.HotExecutor", "src\Natasha.CSharp\Extension\HotExecutor\Natasha.CSharp.HotExecutor\Natasha.CSharp.HotExecutor.csproj", "{1F76ECC0-ABD3-4828-87CD-BE4AEEA4FB66}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Natasha.CSharp.Extension.CompileDirector", "src\Natasha.CSharp\Extension\Natasha.CSharp.Extension.CompileDirector\Natasha.CSharp.Extension.CompileDirector.csproj", "{F1B47923-B3CB-446A-8D52-D8075E65B5F8}"
Expand Down Expand Up @@ -443,10 +441,6 @@ Global
{AC2E37E8-A930-4092-BA9D-2CCC2E895E5D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AC2E37E8-A930-4092-BA9D-2CCC2E895E5D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AC2E37E8-A930-4092-BA9D-2CCC2E895E5D}.Release|Any CPU.Build.0 = Release|Any CPU
{282B1CCD-6C93-442E-B2E7-FD4BB73EC85A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{282B1CCD-6C93-442E-B2E7-FD4BB73EC85A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{282B1CCD-6C93-442E-B2E7-FD4BB73EC85A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{282B1CCD-6C93-442E-B2E7-FD4BB73EC85A}.Release|Any CPU.Build.0 = Release|Any CPU
{1F76ECC0-ABD3-4828-87CD-BE4AEEA4FB66}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1F76ECC0-ABD3-4828-87CD-BE4AEEA4FB66}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1F76ECC0-ABD3-4828-87CD-BE4AEEA4FB66}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -565,7 +559,6 @@ Global
{006A93D1-5DEC-4719-9285-854CE92E2C44} = {F4622BCB-C287-4AFE-916B-8C138BD15A3D}
{67BBDAD5-AFE1-4371-A5CA-C05242A28542} = {B21F1E17-B23E-4E06-9CC4-87F5C8AA7915}
{AC2E37E8-A930-4092-BA9D-2CCC2E895E5D} = {B21F1E17-B23E-4E06-9CC4-87F5C8AA7915}
{282B1CCD-6C93-442E-B2E7-FD4BB73EC85A} = {4DAA9BCB-412E-4668-8723-A42CDEAE72F7}
{1F76ECC0-ABD3-4828-87CD-BE4AEEA4FB66} = {7A3EC767-1531-4472-8896-60B3F649BF34}
{F1B47923-B3CB-446A-8D52-D8075E65B5F8} = {0CB3AF52-50F3-4728-BAC6-389F2E995111}
{39456A90-01B8-4749-B1C7-B1F3082F2466} = {7A3EC767-1531-4472-8896-60B3F649BF34}
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