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

Update script to use recipe; add github workflow #73

Merged
merged 1 commit into from
Mar 7, 2025
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 .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"cake.tool": {
"version": "4.0.0",
"version": "5.0.0",
"commands": [
"dotnet-cake"
],
Expand Down
69 changes: 69 additions & 0 deletions .github/workflows/NUnitProjectLoader.CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: NUnitProjectLoader.CI

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:
MYGET_API_KEY: ${{ secrets.PUBLISH_MYGET_ORG }}
NUGET_API_KEY: ${{ secrets.PUBLISH_NUGET_ORG }}
CHOCO_API_KEY: ${{ secrets.PUBLISH_CHOCOLATEY_ORG }}
GITHUB_ACCESS_TOKEN: ${{ secrets.GH_ACCESS_CP }}

steps:
- name: ⤵️ Checkout Source
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: 🛠️ Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
8.0.100

- name: 🔧 Install dotnet tools
run: dotnet tool restore

- name: 🍰 Run cake script
# If you need to get more verbose logging, add the following to the dotnet-cake call: --verbosity=diagnostic
run: dotnet cake --target=ContinuousIntegration --configuration=Release

- name: 🪵 Upload build logs
if: always()
uses: actions/upload-artifact@v4
with:
name: NUnitConsoleLogs
# 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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ testCaseCollection.xml
deploy
lib
test-results
build-results
package
output
images
Expand Down
4 changes: 2 additions & 2 deletions GitVersion.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
next-version: 3.8.0
next-version: 3.9.0
mode: ContinuousDelivery
legacy-semver-padding: 5
build-metadata-padding: 5
commits-since-version-source-padding: 5
branches:
master:
regex: ^(main|version4)$
tag: dev
tag: alpha
release:
tag: pre
pull-request:
Expand Down
44 changes: 31 additions & 13 deletions build.cake
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
#tool nuget:?package=NUnit.ConsoleRunner&version=3.15.5
#tool nuget:?package=NUnit.ConsoleRunner&version=3.19.2
#tool nuget:?package=NUnit.ConsoleRunner&version=3.18.3
#tool nuget:?package=NUnit.ConsoleRUnner&version=3.17.0
#tool nuget:?package=NUnit.ConsoleRunner&version=3.18.0-dev00037
#tool nuget:?package=NUnit.ConsoleRunner.NetCore&version=3.18.0-dev00037
#tool nuget:?package=NUnit.ConsoleRunner&version=3.15.5
#tool nuget:?package=NUnit.ConsoleRunner.NetCore&version=3.19.2
#tool nuget:?package=NUnit.ConsoleRunner.NetCore&version=3.18.3

// Define runners to be used for testing packages
static readonly IPackageTestRunner[] PACKAGE_TEST_RUNNERS = new IPackageTestRunner[] {
new NUnitConsoleRunner("3.19.2"),
new NUnitConsoleRunner("3.18.3"),
new NUnitConsoleRunner("3.17.0"),
new NUnitConsoleRunner("3.15.5")
//new NUnit3NetCoreConsoleRunner("3.19.2"),
//new NUnit3NetCoreConsoleRunner("3.18.3"),
};

// Load the recipe
#load nuget:?package=NUnit.Cake.Recipe&version=1.4.0-alpha.4
Expand Down Expand Up @@ -59,8 +71,8 @@ PackageTest[] PackageTests = new PackageTest[]
Arguments = "../../PassingAssemblyNetCore.nunit",
ExpectedResult = new ExpectedResult("Passed") {
Total = 4, Passed = 4, Failed = 0, Warnings = 0, Inconclusive = 0, Skipped = 0,
Assemblies = new[] { new ExpectedAssemblyResult("test-lib-1.dll", "netcore-6.0") } },
TestRunners = new IPackageTestRunner[] { (IPackageTestRunner)new NUnit3NetCoreConsoleRunner("3.18.0-dev00037") }
Assemblies = new[] { new ExpectedAssemblyResult("test-lib-1.dll", "netcore-6.0") } }
//TestRunners = new IPackageTestRunner[] { (IPackageTestRunner)new NUnit3NetCoreConsoleRunner("3.19.2") }
},

new PackageTest (1, "SingleNetCoreAssembly_SomeTestsFail")
Expand All @@ -69,8 +81,8 @@ PackageTest[] PackageTests = new PackageTest[]
Arguments = "../../FailingAssemblyNetCore.nunit",
ExpectedResult = new ExpectedResult("Failed") {
Total = 9, Passed = 4, Failed = 2, Warnings = 0, Inconclusive = 1, Skipped = 2,
Assemblies = new[] { new ExpectedAssemblyResult("test-lib-2.dll", "netcore-6.0") } },
TestRunners = new IPackageTestRunner[] { (IPackageTestRunner)new NUnit3NetCoreConsoleRunner("3.18.0-dev00037") }
Assemblies = new[] { new ExpectedAssemblyResult("test-lib-2.dll", "netcore-6.0") } }
//TestRunners = new IPackageTestRunner[] { (IPackageTestRunner)new NUnit3NetCoreConsoleRunner("3.19.2") }
},

new PackageTest (1, "BothNetCoreAssembliesTogether")
Expand All @@ -81,8 +93,8 @@ PackageTest[] PackageTests = new PackageTest[]
Total = 13, Passed = 8, Failed = 2, Warnings = 0, Inconclusive = 1, Skipped = 2,
Assemblies = new[] {
new ExpectedAssemblyResult("test-lib-1.dll", "netcore-6.0"),
new ExpectedAssemblyResult("test-lib-2.dll", "netcore-6.0") } },
TestRunners = new IPackageTestRunner[] { (IPackageTestRunner)new NUnit3NetCoreConsoleRunner("3.18.0-dev00037") }
new ExpectedAssemblyResult("test-lib-2.dll", "netcore-6.0") } }
//TestRunners = new IPackageTestRunner[] { (IPackageTestRunner)new NUnit3NetCoreConsoleRunner("3.19.2") }
}
};

Expand All @@ -101,9 +113,12 @@ BuildSettings.Packages.Add(
HasDirectory("tools/net6.0").WithFiles("nunit-project-loader.dll", "nunit.engine.api.dll") },
tests: PackageTests,
testRunners: new IPackageTestRunner[] {
new NUnitConsoleRunner("3.19.2"),
new NUnitConsoleRunner("3.18.3"),
new NUnitConsoleRunner("3.17.0"),
new NUnitConsoleRunner("3.15.5"),
new NUnitConsoleRunner("3.18.0-dev00037")
new NUnitConsoleRunner("3.15.5")
//new NUnit3NetCoreConsoleRunner("3.19.2"),
//new NUnit3NetCoreConsoleRunner("3.18.3"),
}
));

Expand All @@ -121,9 +136,12 @@ BuildSettings.Packages.Add(
HasDirectory("tools/net6.0").WithFiles("nunit-project-loader.dll", "nunit.engine.api.dll") },
tests: PackageTests,
testRunners: new IPackageTestRunner[] {
//new NUnitConsoleRunner("3.19.2"),
new NUnitConsoleRunner("3.18.3"),
new NUnitConsoleRunner("3.17.0"),
new NUnitConsoleRunner("3.15.5"),
new NUnitConsoleRunner("3.18.0-dev00037")
new NUnitConsoleRunner("3.15.5")
//new NUnit3NetCoreConsoleRunner("3.19.2"),
//new NUnit3NetCoreConsoleRunner("3.18.3"),
}
));

Expand Down
9 changes: 9 additions & 0 deletions nunit-project-loader.sln
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "choco", "choco", "{2DA8DF86
choco\VERIFICATION.txt = choco\VERIFICATION.txt
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{329888D6-1DBB-4B70-890A-9B08C87303CE}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{7250A27B-1B35-4A6A-B256-50155A2175ED}"
ProjectSection(SolutionItems) = preProject
.github\workflows\NUnitProjectLoader.CI.yml = .github\workflows\NUnitProjectLoader.CI.yml
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -71,6 +78,8 @@ Global
GlobalSection(NestedProjects) = preSolution
{6C381491-0062-4276-B884-86A6A175FFF5} = {3B28CF0C-D613-4971-9D8F-00C960C656E2}
{2DA8DF86-18D3-4832-970C-A0B26498B93D} = {3B28CF0C-D613-4971-9D8F-00C960C656E2}
{329888D6-1DBB-4B70-890A-9B08C87303CE} = {3B28CF0C-D613-4971-9D8F-00C960C656E2}
{7250A27B-1B35-4A6A-B256-50155A2175ED} = {329888D6-1DBB-4B70-890A-9B08C87303CE}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {B07C6102-6B2F-4FC3-9F17-FCD093128F6D}
Expand Down
Loading