Skip to content

Commit 0d70d46

Browse files
authored
chore: Build a single project instead of the whole solution (#1502)
1 parent 9eec936 commit 0d70d46

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
github: HofmeisterAn
1+
github: [testcontainers, HofmeisterAn]
22
ko_fi: hofmeister

.github/workflows/cicd.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ jobs:
120120
shell: bash
121121

122122
- name: Run Build
123-
run: ./build.sh --target=Build
123+
run: ./build.sh --target=Build --test-project=${{ matrix.test-projects.name }}
124124
shell: bash
125125

126126
- name: Run Tests

build/Tasks.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,14 @@ public sealed class BuildTask : FrostingTask<BuildContext>
8787
public override void Run(BuildContext context)
8888
{
8989
var param = context.Parameters;
90-
context.DotNetBuild(param.Solution, new DotNetBuildSettings
90+
91+
// If a test project is specified, just build the project and its dependent projects to
92+
// save build time.
93+
var solutionOrProjectFilePath = string.IsNullOrEmpty(param.TestProject)
94+
? param.Solution
95+
: param.Projects.OnlyTests.Single(testProject => testProject.Path.FullPath.EndsWith(param.TestProject + ".Tests.csproj")).Path.FullPath;
96+
97+
context.DotNetBuild(solutionOrProjectFilePath, new DotNetBuildSettings
9198
{
9299
Configuration = param.Configuration,
93100
Verbosity = param.Verbosity,
@@ -193,7 +200,7 @@ public override void Run(BuildContext context)
193200
public sealed class SignNuGetPackagesTask : FrostingTask<BuildContext>
194201
{
195202
// We do not have access to a valid code signing certificate anymore.
196-
public override bool ShouldRun(BuildContext context) => context.Parameters.ShouldPublish && false;
203+
public override bool ShouldRun(BuildContext context) => /* context.Parameters.ShouldPublish */ false;
197204

198205
public override void Run(BuildContext context)
199206
{

0 commit comments

Comments
 (0)