Skip to content

Commit

Permalink
Merge pull request #1141 from TestCentric/issue-1140
Browse files Browse the repository at this point in the history
Create CI workflow and update dependencies
  • Loading branch information
CharliePoole authored Oct 16, 2024
2 parents 6971c79 + b5ab29a commit 03b79d6
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 127 deletions.
72 changes: 2 additions & 70 deletions .github/workflows/testcentric-gui-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
18 changes: 9 additions & 9 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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[] {
Expand Down Expand Up @@ -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[] {
Expand Down
86 changes: 45 additions & 41 deletions package-tests.cake
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand Down
8 changes: 4 additions & 4 deletions src/TestModel/model/TestCentric.Gui.Model.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@

<ItemGroup>
<PackageReference Include="Mono.Options" Version="6.12.0.148" />
<PackageReference Include="TestCentric.Engine" Version="2.0.0-dev00023" />
<PackageReference Include="TestCentric.Engine.Api" Version="2.0.0-dev00017" />
<PackageReference Include="TestCentric.Extensibility" Version="3.0.0" />
<PackageReference Include="TestCentric.InternalTrace" Version="1.2.0" />
<PackageReference Include="TestCentric.Engine" Version="2.0.0-beta6" />
<PackageReference Include="TestCentric.Engine.Api" Version="2.0.0-beta6" />
<PackageReference Include="TestCentric.Extensibility" Version="3.0.2" />
<PackageReference Include="TestCentric.InternalTrace" Version="1.2.1" />
</ItemGroup>

</Project>
6 changes: 3 additions & 3 deletions src/TestModel/tests/TestCentric.Gui.Model.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
<PackageReference Include="NSubstitute" Version="5.1.0" />
<PackageReference Include="NUnit" Version="4.1.0" />
<PackageReference Include="NUnitLite" Version="4.1.0" />
<PackageReference Include="TestCentric.Engine.Api" Version="2.0.0-dev00017" />
<PackageReference Include="TestCentric.Extensibility" Version="3.0.0" />
<PackageReference Include="TestCentric.InternalTrace" Version="1.2.0" />
<PackageReference Include="TestCentric.Engine.Api" Version="2.0.0-beta6" />
<PackageReference Include="TestCentric.Extensibility" Version="3.0.2" />
<PackageReference Include="TestCentric.InternalTrace" Version="1.2.1" />
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.5.4" />
</ItemGroup>

Expand Down

0 comments on commit 03b79d6

Please sign in to comment.