From b5ab29a3a344bed016a34c532af50ae60c90bd2b Mon Sep 17 00:00:00 2001 From: Charlie Poole Date: Tue, 15 Oct 2024 22:25:48 -0700 Subject: [PATCH] Create CI workflow and update dependencies --- .github/workflows/testcentric-gui-ci.yml | 72 +--------------- build.cake | 18 ++-- package-tests.cake | 86 ++++++++++--------- .../model/TestCentric.Gui.Model.csproj | 8 +- .../tests/TestCentric.Gui.Model.Tests.csproj | 6 +- 5 files changed, 63 insertions(+), 127 deletions(-) diff --git a/.github/workflows/testcentric-gui-ci.yml b/.github/workflows/testcentric-gui-ci.yml index b16127e3..6493ca97 100644 --- a/.github/workflows/testcentric-gui-ci.yml +++ b/.github/workflows/testcentric-gui-ci.yml @@ -4,76 +4,8 @@ on: workflow_dispatch: pull_request: push: - paths-ignore: - - "*.txt" - - "*.md" - -env: - DOTNET_NOLOGO: true # Disable the .NET logo - DOTNET_CLI_TELEMETRY_OPTOUT: true # Disable sending .NET CLI telemetry jobs: ContinuousIntegration: - name: Continuous Integration - runs-on: windows-latest - - env: - TESTCENTRIC_MYGET_API_KEY: ${{ secrets.TESTCENTRIC_MYGET_API_KEY }} - TESTCENTRIC_NUGET_API_KEY: ${{ secrets.TESTCENTRIC_NUGET_API_KEY }} - TESTCENTRIC_CHOCO_API_KEY: ${{ secrets.TESTCENTRIC_CHOCO_API_KEY }} - GITHUB_ACCESS_TOKEN: ${{ secrets.TESTCENTRIC_GITHUB_ACCESS_TOKEN }} - - steps: - - name: ⤵️ Checkout Source - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: 🛠️ Setup .NET - uses: actions/setup-dotnet@v4 - with: - dotnet-version: | - 2.1.x - 3.1.x - 5.0.x - 6.0.x - 7.0.x - 8.0.x - - - name: 🔧 Install dotnet tools - run: dotnet tool restore - - - name: 🍰 Run cake - env: - TESTCENTRIC_MYGET_API_KEY: ${{ secrets.TESTCENTRIC_MYGET_API_KEY }} - TESTCENTRIC_NUGET_API_KEY: ${{ secrets.TESTCENTRIC_NUGET_API_KEY }} - TESTCENTRIC_CHOCO_API_KEY: ${{ secrets.TESTCENTRIC_CHOCO_API_KEY }} - GITHUB_ACCESS_TOKEN: ${{ secrets.TESTCENTRIC_GITHUB_ACCESS_TOKEN }} - - # If you need to get more verbose logging, add the following to the dotnet-cake above: --verbosity=diagnostic - run: dotnet cake --target=ContinuousIntegration --configuration=Release - - - name: 🪵 Upload build logs - if: always() - uses: actions/upload-artifact@v4 - with: - name: Upload Console Logs - # This path is defined in build-settings.cake - path: "build-results/*.binlog" - # if-no-files-found: error - - - name: 🪵 Upload InternalTrace logs - if: always() - uses: actions/upload-artifact@v4 - with: - name: InternalTraceLogs - # This path is defined in build-settings.cake - path: "*.log" - # if-no-files-found: error - - - name: 💾 Upload test results - uses: actions/upload-artifact@v4 - if: always() - with: - name: "Test Results" - path: test-results + uses: TestCentric/TestCentric.Workflows/.github/workflows/testcentric-ci.yml@main + secrets: inherit \ No newline at end of file diff --git a/build.cake b/build.cake index a7cd3be8..2143bbe5 100644 --- a/build.cake +++ b/build.cake @@ -4,7 +4,7 @@ const string REF_ENGINE_VERSION = "2.0.0-dev00023"; // Load the recipe -#load nuget:?package=TestCentric.Cake.Recipe&version=1.3.2 +#load nuget:?package=TestCentric.Cake.Recipe&version=1.3.3 // Comment out above line and uncomment below for local tests of recipe changes //#load ../TestCentric.Cake.Recipe/recipe/*.cake @@ -74,10 +74,10 @@ var nugetPackage = new NuGetPackage( new DirectoryContent("tools/Images/Tree/Visual Studio").WithFiles( "Images/Tree/Visual Studio/Success.png", "Images/Tree/Visual Studio/Failure.png", "Images/Tree/Visual Studio/Ignored.png", "Images/Tree/Visual Studio/Inconclusive.png", "Images/Tree/Visual Studio/Skipped.png") ) .WithDependencies( - KnownExtensions.Net462PluggableAgent.NuGetPackage.LatestDevBuild, - KnownExtensions.Net60PluggableAgent.NuGetPackage.LatestDevBuild, - KnownExtensions.Net70PluggableAgent.NuGetPackage.LatestDevBuild, - KnownExtensions.Net80PluggableAgent.NuGetPackage.LatestDevBuild + KnownExtensions.Net462PluggableAgent.SetVersion("2.5.1").NuGetPackage, + KnownExtensions.Net60PluggableAgent.SetVersion("2.5.1").NuGetPackage, + KnownExtensions.Net70PluggableAgent.SetVersion("2.5.1").NuGetPackage, + KnownExtensions.Net80PluggableAgent.SetVersion("2.5.1").NuGetPackage ), testRunner: new GuiSelfTester(BuildSettings.NuGetTestDirectory + "TestCentric.GuiRunner." + BuildSettings.PackageVersion + "/tools/testcentric.exe"), checks: new PackageCheck[] { @@ -113,10 +113,10 @@ var chocolateyPackage = new ChocolateyPackage( new DirectoryContent("tools/Images/Tree/Visual Studio").WithFiles( "Images/Tree/Visual Studio/Success.png", "Images/Tree/Visual Studio/Failure.png", "Images/Tree/Visual Studio/Ignored.png", "Images/Tree/Visual Studio/Inconclusive.png", "Images/Tree/Visual Studio/Skipped.png") ) .WithDependencies( - KnownExtensions.Net462PluggableAgent.ChocoPackage.LatestDevBuild, - KnownExtensions.Net60PluggableAgent.ChocoPackage.LatestDevBuild, - KnownExtensions.Net70PluggableAgent.ChocoPackage.LatestDevBuild, - KnownExtensions.Net80PluggableAgent.ChocoPackage.LatestDevBuild + KnownExtensions.Net462PluggableAgent.SetVersion("2.5.1").ChocoPackage, + KnownExtensions.Net60PluggableAgent.SetVersion("2.5.1").ChocoPackage, + KnownExtensions.Net70PluggableAgent.SetVersion("2.5.1").ChocoPackage, + KnownExtensions.Net80PluggableAgent.SetVersion("2.5.1").ChocoPackage ), testRunner: new GuiSelfTester(BuildSettings.ChocolateyTestDirectory + "testcentric-gui." + BuildSettings.PackageVersion + "/tools/testcentric.exe"), checks: new PackageCheck[] { diff --git a/package-tests.cake b/package-tests.cake index e6b2845e..ac22683f 100644 --- a/package-tests.cake +++ b/package-tests.cake @@ -5,37 +5,39 @@ public static void DefinePackageTests() if (BuildSettings.Context == null) throw new Exception("Trying to use BuildSettings before it is initialized"); - // Define Package Tests + // Define Package Tests // Level 1 tests are run each time we build the packages // Level 2 tests are run for PRs and when packages will be published // Level 3 tests are run only when publishing a release - // Tests of single assemblies targeting each runtime we support + // Tests of single assemblies targeting each runtime we support - PackageTests.Add(new PackageTest(1, "Net462Test", "Run net462 mock-assembly.dll under .NET 4.6.2", - "net462/mock-assembly.dll", - MockAssemblyExpectedResult("Net462AgentLauncher"))); + PackageTests.Add(new PackageTest(1, "Net462Test", "Run net462 mock-assembly.dll under .NET 4.6.2", + "net462/mock-assembly.dll", + MockAssemblyExpectedResult("Net462AgentLauncher"))); - PackageTests.Add(new PackageTest(1, "Net462X86Test", "Run net462 mock-assembly-x86.dll under .NET 4.6.2", - "net462/mock-assembly-x86.dll", - MockAssemblyX86ExpectedResult("Net462AgentLauncher"))); + PackageTests.Add(new PackageTest(1, "Net462X86Test", "Run net462 mock-assembly-x86.dll under .NET 4.6.2", + "net462/mock-assembly-x86.dll", + MockAssemblyX86ExpectedResult("Net462AgentLauncher"))); - PackageTests.Add(new PackageTest(1, "Net35Test", "Run net35 mock-assembly.dll under .NET 4.6.2", - "net35/mock-assembly.dll", + PackageTests.Add(new PackageTest(1, "Net35Test", "Run net35 mock-assembly.dll under .NET 4.6.2", + "net35/mock-assembly.dll", MockAssemblyExpectedResult("Net462AgentLauncher"))); - PackageTests.Add(new PackageTest(1, "Net35X86Test", "Run net35 mock-assembly-x86.dll under .NET 4.6.2", - "net35/mock-assembly-x86.dll", + PackageTests.Add(new PackageTest(1, "Net35X86Test", "Run net35 mock-assembly-x86.dll under .NET 4.6.2", + "net35/mock-assembly-x86.dll", MockAssemblyX86ExpectedResult("Net462AgentLauncher"))); - if (!BuildSettings.IsRunningOnAppVeyor) + if (BuildSettings.IsLocalBuild) + { PackageTests.Add(new PackageTest(1, "NetCore21Test", "Run .NET Core 2.1 mock-assembly.dll under .NET Core 3.1", "netcoreapp2.1/mock-assembly.dll", MockAssemblyExpectedResult("Net60AgentLauncher"))); - PackageTests.Add(new PackageTest(1, "NetCore31Test", "Run mock-assembly.dll under .NET Core 3.1", - "netcoreapp3.1/mock-assembly.dll", - MockAssemblyExpectedResult("Net60AgentLauncher"))); + PackageTests.Add(new PackageTest(1, "NetCore31Test", "Run mock-assembly.dll under .NET Core 3.1", + "netcoreapp3.1/mock-assembly.dll", + MockAssemblyExpectedResult("Net60AgentLauncher"))); + } // PackageTests.Add(new PackageTest(1, "NetCore11Test", "Run mock-assembly.dll targeting .NET Core 1.1", // "netcoreapp1.1/mock-assembly.dll", @@ -50,10 +52,10 @@ public static void DefinePackageTests() //Assemblies = new[] { new ExpectedAssemblyResult("mock-assembly.dll", "netcore-1.1") } // })); - if (!BuildSettings.IsRunningOnAppVeyor) - PackageTests.Add(new PackageTest(1, "Net50Test", "Run mock-assembly.dll under .NET 5.0", - "net5.0/mock-assembly.dll", - MockAssemblyExpectedResult("Net60AgentLauncher"))); + if (BuildSettings.IsLocalBuild) + PackageTests.Add(new PackageTest(1, "Net50Test", "Run mock-assembly.dll under .NET 5.0", + "net5.0/mock-assembly.dll", + MockAssemblyExpectedResult("Net60AgentLauncher"))); PackageTests.Add(new PackageTest(1, "Net60Test", "Run mock-assembly.dll under .NET 6.0", "net6.0/mock-assembly.dll", @@ -69,20 +71,22 @@ public static void DefinePackageTests() // AspNetCore tests - PackageTests.Add(new PackageTest(1, "AspNetCore31Test", "Run test using AspNetCore under .NET Core 3.1", - "netcoreapp3.1/aspnetcore-test.dll", - new ExpectedResult("Passed") - { - Assemblies = new [] { new ExpectedAssemblyResult("aspnetcore-test.dll", "Net60AgentLauncher") } - })); - - if (!BuildSettings.IsRunningOnAppVeyor) - PackageTests.Add(new PackageTest(1, "AspNetCore50Test", "Run test using AspNetCore under .NET 5.0", - "net5.0/aspnetcore-test.dll", - new ExpectedResult("Passed") - { - Assemblies = new [] { new ExpectedAssemblyResult("aspnetcore-test.dll", "Net60AgentLauncher") } - })); + if (BuildSettings.IsLocalBuild) + { + PackageTests.Add(new PackageTest(1, "AspNetCore31Test", "Run test using AspNetCore under .NET Core 3.1", + "netcoreapp3.1/aspnetcore-test.dll", + new ExpectedResult("Passed") + { + Assemblies = new[] { new ExpectedAssemblyResult("aspnetcore-test.dll", "Net60AgentLauncher") } + })); + + PackageTests.Add(new PackageTest(1, "AspNetCore50Test", "Run test using AspNetCore under .NET 5.0", + "net5.0/aspnetcore-test.dll", + new ExpectedResult("Passed") + { + Assemblies = new[] { new ExpectedAssemblyResult("aspnetcore-test.dll", "Net60AgentLauncher") } + })); + } PackageTests.Add(new PackageTest(1, "AspNetCore60Test", "Run test using AspNetCore under .NET 6.0", "net6.0/aspnetcore-test.dll", @@ -100,13 +104,13 @@ public static void DefinePackageTests() // Windows Forms Tests - if (!BuildSettings.IsRunningOnAppVeyor) - PackageTests.Add(new PackageTest(1, "Net50WindowsFormsTest", "Run test using windows forms under .NET 5.0", - "net5.0-windows/windows-forms-test.dll", - new ExpectedResult("Passed") - { - Assemblies = new [] { new ExpectedAssemblyResult("windows-forms-test.dll", "Net60AgentLauncher") } - })); + if (BuildSettings.IsLocalBuild) + PackageTests.Add(new PackageTest(1, "Net50WindowsFormsTest", "Run test using windows forms under .NET 5.0", + "net5.0-windows/windows-forms-test.dll", + new ExpectedResult("Passed") + { + Assemblies = new [] { new ExpectedAssemblyResult("windows-forms-test.dll", "Net60AgentLauncher") } + })); PackageTests.Add(new PackageTest(1, "Net60WindowsFormsTest", "Run test using windows forms under .NET 6.0", "net6.0-windows/windows-forms-test.dll", diff --git a/src/TestModel/model/TestCentric.Gui.Model.csproj b/src/TestModel/model/TestCentric.Gui.Model.csproj index 7fda2429..306f2f06 100644 --- a/src/TestModel/model/TestCentric.Gui.Model.csproj +++ b/src/TestModel/model/TestCentric.Gui.Model.csproj @@ -15,10 +15,10 @@ - - - - + + + + \ No newline at end of file diff --git a/src/TestModel/tests/TestCentric.Gui.Model.Tests.csproj b/src/TestModel/tests/TestCentric.Gui.Model.Tests.csproj index 1a07f0fa..1e737272 100644 --- a/src/TestModel/tests/TestCentric.Gui.Model.Tests.csproj +++ b/src/TestModel/tests/TestCentric.Gui.Model.Tests.csproj @@ -23,9 +23,9 @@ - - - + + +