From d2560750d838ece380c72e1f9c605d22c4561f6f Mon Sep 17 00:00:00 2001 From: IExploitableMan Date: Sun, 7 Sep 2025 10:22:42 +0300 Subject: [PATCH 1/3] Add test project, add testing to CI --- .github/workflows/cicd.yml | 4 ++-- PolyMod.sln | 6 ++++- PolyMod.csproj => src/PolyMod.csproj | 0 tests/Tests.csproj | 35 ++++++++++++++++++++++++++++ tests/UnitTest1.cs | 10 ++++++++ tests/xunit.runner.json | 3 +++ 6 files changed, 55 insertions(+), 3 deletions(-) rename PolyMod.csproj => src/PolyMod.csproj (100%) create mode 100644 tests/Tests.csproj create mode 100644 tests/UnitTest1.cs create mode 100644 tests/xunit.runner.json diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index db51c1a..8a4b34d 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -15,8 +15,8 @@ jobs: with: path: ~/.nuget/packages key: nuget-${{ hashFiles('**/*.csproj') }} - - name: Build - run: dotnet build -warnaserror + - name: Build and test + run: dotnet test -warnaserror - name: Build nuget if: github.event_name == 'workflow_dispatch' run: dotnet pack PolyMod.csproj -o nuget diff --git a/PolyMod.sln b/PolyMod.sln index 2e325f4..668e23f 100644 --- a/PolyMod.sln +++ b/PolyMod.sln @@ -3,7 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.4.33205.214 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PolyMod", "PolyMod.csproj", "{58B09361-FD7A-48F1-82E1-E2359ADA512F}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PolyMod", "src\PolyMod.csproj", "{58B09361-FD7A-48F1-82E1-E2359ADA512F}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "tests\Tests.csproj", "{85432E7B-2023-477C-861E-0141E8974DDC}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -12,6 +14,8 @@ Global GlobalSection(ProjectConfigurationPlatforms) = postSolution {58B09361-FD7A-48F1-82E1-E2359ADA512F}.IL2CPP|Any CPU.ActiveCfg = IL2CPP|Any CPU {58B09361-FD7A-48F1-82E1-E2359ADA512F}.IL2CPP|Any CPU.Build.0 = IL2CPP|Any CPU + {85432E7B-2023-477C-861E-0141E8974DDC}.IL2CPP|Any CPU.ActiveCfg = IL2CPP|Any CPU + {85432E7B-2023-477C-861E-0141E8974DDC}.IL2CPP|Any CPU.Build.0 = IL2CPP|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/PolyMod.csproj b/src/PolyMod.csproj similarity index 100% rename from PolyMod.csproj rename to src/PolyMod.csproj diff --git a/tests/Tests.csproj b/tests/Tests.csproj new file mode 100644 index 0000000..9aa362f --- /dev/null +++ b/tests/Tests.csproj @@ -0,0 +1,35 @@ + + + enable + enable + tests + net8.0 + false + + + + + + + + + + + + + + + + + + + diff --git a/tests/UnitTest1.cs b/tests/UnitTest1.cs new file mode 100644 index 0000000..a54dd9a --- /dev/null +++ b/tests/UnitTest1.cs @@ -0,0 +1,10 @@ +namespace Tests; + +public class UnitTest1 +{ + [Fact] + public void Test1() + { + Assert.True(true); + } +} diff --git a/tests/xunit.runner.json b/tests/xunit.runner.json new file mode 100644 index 0000000..249d815 --- /dev/null +++ b/tests/xunit.runner.json @@ -0,0 +1,3 @@ +{ + "$schema": "https://xunit.net/schema/current/xunit.runner.schema.json" +} From 581980d5054fadb9534eb62ab846017e1d1dbde1 Mon Sep 17 00:00:00 2001 From: Lubyanoy Ivan Date: Sun, 7 Sep 2025 11:26:58 +0300 Subject: [PATCH 2/3] Fix testing in CI --- .github/workflows/cicd.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 8a4b34d..2f89c64 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -15,8 +15,10 @@ jobs: with: path: ~/.nuget/packages key: nuget-${{ hashFiles('**/*.csproj') }} - - name: Build and test - run: dotnet test -warnaserror + - name: Build + run: dotnet build -warnaserror + - name: Test + run: dotnet test --no-build - name: Build nuget if: github.event_name == 'workflow_dispatch' run: dotnet pack PolyMod.csproj -o nuget From b75e56fe0b8de6620e40a9ac097cacd4b6a0e63d Mon Sep 17 00:00:00 2001 From: IExploitableMan Date: Sun, 7 Sep 2025 11:32:26 +0300 Subject: [PATCH 3/3] Fix NuGet sources --- .github/workflows/cicd.yml | 6 ++---- nuget.config | 9 +++++++++ src/PolyMod.csproj | 6 ------ 3 files changed, 11 insertions(+), 10 deletions(-) create mode 100644 nuget.config diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 2f89c64..8a4b34d 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -15,10 +15,8 @@ jobs: with: path: ~/.nuget/packages key: nuget-${{ hashFiles('**/*.csproj') }} - - name: Build - run: dotnet build -warnaserror - - name: Test - run: dotnet test --no-build + - name: Build and test + run: dotnet test -warnaserror - name: Build nuget if: github.event_name == 'workflow_dispatch' run: dotnet pack PolyMod.csproj -o nuget diff --git a/nuget.config b/nuget.config new file mode 100644 index 0000000..6ebe1ff --- /dev/null +++ b/nuget.config @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/src/PolyMod.csproj b/src/PolyMod.csproj index 072a080..fe88ce2 100644 --- a/src/PolyMod.csproj +++ b/src/PolyMod.csproj @@ -3,12 +3,6 @@ net6.0 enable enable - - https://api.nuget.org/v3/index.json; - https://nuget.bepinex.dev/v3/index.json; - https://nuget.samboy.dev/v3/index.json; - https://polymod.dev/nuget/v3/index.json; - IL2CPP 1.2.0-pre 2.13.0.14218