Skip to content

Commit 041eeab

Browse files
Copilotradical
andcommitted
Add BuildTestsOnly property to reduce disk space usage
Co-authored-by: radical <[email protected]>
1 parent 71e9a53 commit 041eeab

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

.github/workflows/specialized-test-runner.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,16 @@ jobs:
3636
steps:
3737
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3838

39-
# We need to build the whole solution, so that we can interrogate each test project
39+
# We need to build test projects, so that we can interrogate each test project
4040
# and find out whether it contains any tests of the specified type.
41+
# We use BuildTestsOnly=true to reduce disk space usage by skipping src, playground, and pack projects.
4142
- name: Build the solution
4243
run: >
4344
./build.sh
4445
--restore
4546
--build
4647
-c Release
48+
/p:BuildTestsOnly=true
4749
/p:GeneratePackageOnBuild=false
4850
${{ !inputs.enablePlaywrightInstall && '/p:InstallBrowsersForPlaywright=false' || '' }}
4951

eng/Build.props

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77
<TargetRids Condition="'$(TargetRids)' == ''">$(BuildRid)</TargetRids>
88
</PropertyGroup>
99

10-
<ItemGroup Condition="'$(SkipManagedBuild)' != 'true'">
10+
<!-- `$(BuildTestsOnly)` allows building only test projects, skipping src, playground,
11+
and pack projects. This is useful for reducing disk space usage when only test
12+
projects need to be built, such as during test runsheet generation. -->
13+
<ItemGroup Condition="'$(SkipManagedBuild)' != 'true' and '$(BuildTestsOnly)' != 'true'">
1114
<!-- Project name validation runs once in the outer build -->
1215
<ProjectToBuild Include="$(RepoRoot)eng\OuterPreBuild.proj" />
1316

@@ -16,11 +19,13 @@
1619
<ProjectToBuild Include="$(RepoRoot)eng\dashboardpack\**\*.csproj" />
1720

1821
<ProjectToBuild Include="$(RepoRoot)playground\**\*.csproj" />
22+
</ItemGroup>
1923

20-
<!-- `$(SkipTestProjects)` allows skipping test projects from being
21-
included in the build at all. This is useful for cases like when we are
22-
just building the packages, and don't need to build the test projects. -->
23-
<ProjectToBuild Include="$(RepoRoot)tests\**\*.csproj" Condition="'$(SkipTestProjects)' != 'true'" />
24+
<!-- `$(SkipTestProjects)` allows skipping test projects from being
25+
included in the build at all. This is useful for cases like when we are
26+
just building the packages, and don't need to build the test projects. -->
27+
<ItemGroup Condition="'$(SkipManagedBuild)' != 'true' and '$(SkipTestProjects)' != 'true'">
28+
<ProjectToBuild Include="$(RepoRoot)tests\**\*.csproj" />
2429
</ItemGroup>
2530

2631
<!-- Extension build project -->

0 commit comments

Comments
 (0)