Skip to content

Commit cdaadde

Browse files
committed
(build) add separate project for building the CI matrix
1 parent f627d76 commit cdaadde

File tree

9 files changed

+32
-29
lines changed

9 files changed

+32
-29
lines changed

build/.run/DockerMatrix.run.xml

Lines changed: 0 additions & 20 deletions
This file was deleted.

build/.run/TestMatrix.run.xml renamed to build/.run/SetMatrix.run.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<component name="ProjectRunConfigurationManager">
2-
<configuration default="false" name="TestMatrix" type="DotNetProject" factoryName=".NET Project" folderName="Config">
2+
<configuration default="false" name="SetMatrix" type="DotNetProject" factoryName=".NET Project" folderName="Config">
33
<option name="EXE_PATH" value="$PROJECT_DIR$/../run/config" />
4-
<option name="PROGRAM_PARAMETERS" value="--target=TestMatrix" />
4+
<option name="PROGRAM_PARAMETERS" value="--target=SetMatrix" />
55
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/.." />
66
<option name="PASS_PARENT_ENVS" value="1" />
77
<option name="USE_EXTERNAL_CONSOLE" value="0" />

build/CI.sln

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "build", "build\build.csproj
1414
EndProject
1515
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "common", "common\common.csproj", "{8B04D233-2891-44D8-A7D2-0EAFD38F1F70}"
1616
EndProject
17-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "chores", "chores\chores.csproj", "{E8346E70-2A34-460E-90FD-DFD5B15FD476}"
17+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "config", "config\config.csproj", "{E8346E70-2A34-460E-90FD-DFD5B15FD476}"
1818
EndProject
1919
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "artifacts", "artifacts\artifacts.csproj", "{7162B10E-40A1-44E3-AE5E-E7D1755AADAD}"
2020
EndProject
@@ -73,6 +73,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docker-publish", "docker-pu
7373
EndProjectSection
7474
EndProject
7575
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docker-test", "docker-test", "{965AC311-8A65-4AEB-B11F-3E4EBDFFBB8F}"
76+
ProjectSection(SolutionItems) = preProject
77+
..\.github\actions\docker-test\action.yml = ..\.github\actions\docker-test\action.yml
78+
EndProjectSection
7679
EndProject
7780
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "artifacts-restore", "artifacts-restore", "{FF815E24-AE9E-49E5-BC93-F859450F9CD0}"
7881
ProjectSection(SolutionItems) = preProject
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
namespace Chores;
1+
namespace Config;
22

33
public class BuildContext(ICakeContext context) : FrostingContext(context);

build/chores/BuildLifetime.cs renamed to build/config/BuildLifetime.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using Common.Utilities;
22

3-
namespace Chores;
3+
namespace Config;
44

55
public class BuildLifetime : FrostingLifetime<BuildContext>
66
{

build/chores/Program.cs renamed to build/config/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Chores;
1+
using Config;
22

33
return new CakeHost()
44
.UseContext<BuildContext>()
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace Chores.Tasks;
1+
namespace Config.Tasks;
22

33
[TaskDescription("Shows this output")]
44
public class Default : Common.Tasks.Default;

build/config/Tasks/SetMatrix.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using Cake.Json;
2+
3+
namespace Config.Tasks;
4+
5+
public class SetMatrix : FrostingTask<BuildContext>
6+
{
7+
public override void Run(BuildContext context)
8+
{
9+
if (context.BuildSystem().IsRunningOnGitHubActions)
10+
{
11+
context.GitHubActions().Commands.SetOutputParameter("dockerDistros", context.SerializeJson(Constants.DockerDistros));
12+
context.GitHubActions().Commands.SetOutputParameter("dotnetVersions", context.SerializeJson(Constants.DotnetVersions));
13+
}
14+
else
15+
{
16+
context.Information("Docker Distros: {0}", context.SerializeJson(Constants.DockerDistros));
17+
context.Information("Dotnet Versions: {0}", context.SerializeJson(Constants.DotnetVersions));
18+
}
19+
}
20+
}

build/chores/chores.csproj renamed to build/config/config.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<AssemblyName>chores</AssemblyName>
4-
<RootNamespace>Chores</RootNamespace>
3+
<RootNamespace>Config</RootNamespace>
4+
<PackageId>config</PackageId>
55
</PropertyGroup>
66
<ItemGroup>
77
<ProjectReference Include="..\common\common.csproj" />

0 commit comments

Comments
 (0)