Skip to content

Commit 4d7a35b

Browse files
committed
Update script to use recipe; add github workflow
1 parent 8253037 commit 4d7a35b

File tree

6 files changed

+113
-16
lines changed

6 files changed

+113
-16
lines changed

.config/dotnet-tools.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"isRoot": true,
44
"tools": {
55
"cake.tool": {
6-
"version": "4.0.0",
6+
"version": "5.0.0",
77
"commands": [
88
"dotnet-cake"
99
],
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: NUnitProjectLoader.CI
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
push:
7+
paths-ignore:
8+
- "*.txt"
9+
- "*.md"
10+
11+
env:
12+
DOTNET_NOLOGO: true # Disable the .NET logo
13+
DOTNET_CLI_TELEMETRY_OPTOUT: true # Disable sending .NET CLI telemetry
14+
15+
jobs:
16+
ContinuousIntegration:
17+
name: Continuous Integration
18+
runs-on: windows-latest
19+
20+
env:
21+
MYGET_API_KEY: ${{ secrets.PUBLISH_MYGET_ORG }}
22+
NUGET_API_KEY: ${{ secrets.PUBLISH_NUGET_ORG }}
23+
CHOCO_API_KEY: ${{ secrets.PUBLISH_CHOCOLATEY_ORG }}
24+
GITHUB_ACCESS_TOKEN: ${{ secrets.GH_ACCESS_CP }}
25+
26+
steps:
27+
- name: ⤵️ Checkout Source
28+
uses: actions/checkout@v4
29+
with:
30+
fetch-depth: 0
31+
32+
- name: 🛠️ Setup .NET
33+
uses: actions/setup-dotnet@v4
34+
with:
35+
dotnet-version: |
36+
6.0.x
37+
8.0.100
38+
39+
- name: 🔧 Install dotnet tools
40+
run: dotnet tool restore
41+
42+
- name: 🍰 Run cake script
43+
# If you need to get more verbose logging, add the following to the dotnet-cake call: --verbosity=diagnostic
44+
run: dotnet cake --target=ContinuousIntegration --configuration=Release
45+
46+
- name: 🪵 Upload build logs
47+
if: always()
48+
uses: actions/upload-artifact@v4
49+
with:
50+
name: NUnitConsoleLogs
51+
# This path is defined in build-settings.cake
52+
path: "build-results/*.binlog"
53+
# if-no-files-found: error
54+
55+
- name: 🪵 Upload InternalTrace logs
56+
if: always()
57+
uses: actions/upload-artifact@v4
58+
with:
59+
name: InternalTraceLogs
60+
# This path is defined in build-settings.cake
61+
path: "*.log"
62+
# if-no-files-found: error
63+
64+
- name: 💾 Upload test results
65+
uses: actions/upload-artifact@v4
66+
if: always()
67+
with:
68+
name: "Test Results"
69+
path: test-results

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ testCaseCollection.xml
173173
deploy
174174
lib
175175
test-results
176+
build-results
176177
package
177178
output
178179
images

GitVersion.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
next-version: 3.8.0
1+
next-version: 3.9.0
22
mode: ContinuousDelivery
33
legacy-semver-padding: 5
44
build-metadata-padding: 5
55
commits-since-version-source-padding: 5
66
branches:
77
master:
88
regex: ^(main|version4)$
9-
tag: dev
9+
tag: alpha
1010
release:
1111
tag: pre
1212
pull-request:

build.cake

Lines changed: 31 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
1-
#tool nuget:?package=NUnit.ConsoleRunner&version=3.15.5
1+
#tool nuget:?package=NUnit.ConsoleRunner&version=3.19.2
2+
#tool nuget:?package=NUnit.ConsoleRunner&version=3.18.3
23
#tool nuget:?package=NUnit.ConsoleRUnner&version=3.17.0
3-
#tool nuget:?package=NUnit.ConsoleRunner&version=3.18.0-dev00037
4-
#tool nuget:?package=NUnit.ConsoleRunner.NetCore&version=3.18.0-dev00037
4+
#tool nuget:?package=NUnit.ConsoleRunner&version=3.15.5
5+
#tool nuget:?package=NUnit.ConsoleRunner.NetCore&version=3.19.2
6+
#tool nuget:?package=NUnit.ConsoleRunner.NetCore&version=3.18.3
7+
8+
// Define runners to be used for testing packages
9+
static readonly IPackageTestRunner[] PACKAGE_TEST_RUNNERS = new IPackageTestRunner[] {
10+
new NUnitConsoleRunner("3.19.2"),
11+
new NUnitConsoleRunner("3.18.3"),
12+
new NUnitConsoleRunner("3.17.0"),
13+
new NUnitConsoleRunner("3.15.5")
14+
//new NUnit3NetCoreConsoleRunner("3.19.2"),
15+
//new NUnit3NetCoreConsoleRunner("3.18.3"),
16+
};
517

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

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

7688
new PackageTest (1, "BothNetCoreAssembliesTogether")
@@ -81,8 +93,8 @@ PackageTest[] PackageTests = new PackageTest[]
8193
Total = 13, Passed = 8, Failed = 2, Warnings = 0, Inconclusive = 1, Skipped = 2,
8294
Assemblies = new[] {
8395
new ExpectedAssemblyResult("test-lib-1.dll", "netcore-6.0"),
84-
new ExpectedAssemblyResult("test-lib-2.dll", "netcore-6.0") } },
85-
TestRunners = new IPackageTestRunner[] { (IPackageTestRunner)new NUnit3NetCoreConsoleRunner("3.18.0-dev00037") }
96+
new ExpectedAssemblyResult("test-lib-2.dll", "netcore-6.0") } }
97+
//TestRunners = new IPackageTestRunner[] { (IPackageTestRunner)new NUnit3NetCoreConsoleRunner("3.19.2") }
8698
}
8799
};
88100

@@ -101,9 +113,12 @@ BuildSettings.Packages.Add(
101113
HasDirectory("tools/net6.0").WithFiles("nunit-project-loader.dll", "nunit.engine.api.dll") },
102114
tests: PackageTests,
103115
testRunners: new IPackageTestRunner[] {
116+
new NUnitConsoleRunner("3.19.2"),
117+
new NUnitConsoleRunner("3.18.3"),
104118
new NUnitConsoleRunner("3.17.0"),
105-
new NUnitConsoleRunner("3.15.5"),
106-
new NUnitConsoleRunner("3.18.0-dev00037")
119+
new NUnitConsoleRunner("3.15.5")
120+
//new NUnit3NetCoreConsoleRunner("3.19.2"),
121+
//new NUnit3NetCoreConsoleRunner("3.18.3"),
107122
}
108123
));
109124

@@ -121,9 +136,12 @@ BuildSettings.Packages.Add(
121136
HasDirectory("tools/net6.0").WithFiles("nunit-project-loader.dll", "nunit.engine.api.dll") },
122137
tests: PackageTests,
123138
testRunners: new IPackageTestRunner[] {
139+
//new NUnitConsoleRunner("3.19.2"),
140+
new NUnitConsoleRunner("3.18.3"),
124141
new NUnitConsoleRunner("3.17.0"),
125-
new NUnitConsoleRunner("3.15.5"),
126-
new NUnitConsoleRunner("3.18.0-dev00037")
142+
new NUnitConsoleRunner("3.15.5")
143+
//new NUnit3NetCoreConsoleRunner("3.19.2"),
144+
//new NUnit3NetCoreConsoleRunner("3.18.3"),
127145
}
128146
));
129147

nunit-project-loader.sln

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "choco", "choco", "{2DA8DF86
4242
choco\VERIFICATION.txt = choco\VERIFICATION.txt
4343
EndProjectSection
4444
EndProject
45+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{329888D6-1DBB-4B70-890A-9B08C87303CE}"
46+
EndProject
47+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{7250A27B-1B35-4A6A-B256-50155A2175ED}"
48+
ProjectSection(SolutionItems) = preProject
49+
.github\workflows\NUnitProjectLoader.CI.yml = .github\workflows\NUnitProjectLoader.CI.yml
50+
EndProjectSection
51+
EndProject
4552
Global
4653
GlobalSection(SolutionConfigurationPlatforms) = preSolution
4754
Debug|Any CPU = Debug|Any CPU
@@ -71,6 +78,8 @@ Global
7178
GlobalSection(NestedProjects) = preSolution
7279
{6C381491-0062-4276-B884-86A6A175FFF5} = {3B28CF0C-D613-4971-9D8F-00C960C656E2}
7380
{2DA8DF86-18D3-4832-970C-A0B26498B93D} = {3B28CF0C-D613-4971-9D8F-00C960C656E2}
81+
{329888D6-1DBB-4B70-890A-9B08C87303CE} = {3B28CF0C-D613-4971-9D8F-00C960C656E2}
82+
{7250A27B-1B35-4A6A-B256-50155A2175ED} = {329888D6-1DBB-4B70-890A-9B08C87303CE}
7483
EndGlobalSection
7584
GlobalSection(ExtensibilityGlobals) = postSolution
7685
SolutionGuid = {B07C6102-6B2F-4FC3-9F17-FCD093128F6D}

0 commit comments

Comments
 (0)