Skip to content

Commit f60dcb6

Browse files
committed
[CI] Outerloop/Quarantined workflows - build only the required bits
The `build solution` step in `Generate runsheet` job was running out of space. The agent starts with around 22G free. After the changes here to limit the build to only the test jobs: - the disk has 5.3G free after the build - The build time goes down from ~7 mins to ~4 mins. Fixes #12143
1 parent b045f8e commit f60dcb6

File tree

2 files changed

+38
-7
lines changed

2 files changed

+38
-7
lines changed

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

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,23 @@ 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+
- name: Show disk usage before build
40+
run: |-
41+
df -h
42+
du -sh ${{ github.workspace }}
43+
44+
# We need to build test projects, so that we can interrogate each test project
4045
# and find out whether it contains any tests of the specified type.
46+
# We use BuildTestsOnly=true to reduce disk space usage by skipping src, playground, and pack projects.
4147
- name: Build the solution
4248
run: >
4349
./build.sh
4450
--restore
4551
--build
4652
-c Release
53+
/p:BuildTestsOnly=true
4754
/p:GeneratePackageOnBuild=false
48-
${{ !inputs.enablePlaywrightInstall && '/p:InstallBrowsersForPlaywright=false' || '' }}
55+
/p:InstallBrowsersForPlaywright=false
4956
5057
- name: Generate test runsheet
5158
id: generate_tests_matrix
@@ -59,8 +66,17 @@ jobs:
5966
-c Release
6067
/p:Restore=false
6168
/p:Build=false
69+
/p:InstallBrowsersForPlaywright=false
6270
/bl:${{ github.workspace }}/artifacts/log/Release/runsheet.binlog
6371
72+
- name: Show disk usage after build
73+
if: ${{ always() }}
74+
run: |-
75+
df -h
76+
du -d 1 h ~/.nuget/packages
77+
du -d 1 -h ${{ github.workspace }}
78+
du -d 1 -h ${{ github.workspace }}/artifacts
79+
6480
- name: Upload logs, and test results
6581
if: ${{ always() }}
6682
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1

eng/Build.props

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
11
<Project TreatAsLocalProperty="TargetRids">
2+
<!--
3+
Properties:
4+
SkipManagedBuild - if 'true', skips building all managed projects, defaults to 'false'
5+
SkipNativeBuild - if 'true', skips building all native projects, defaults to 'false'
6+
BuildExtension - if 'true', builds the extension project, defaults to 'false'
7+
BuildTestsOnly - if 'true', builds only test projects, defaults to 'false'
8+
SkipTestProjects - if 'true', skips building test projects, defaults to 'false'
9+
TargetRids - colon separated list of RIDs to build native projects for
10+
-->
11+
212
<PropertyGroup>
313
<BuildRid>$([System.Runtime.InteropServices.RuntimeInformation]::RuntimeIdentifier)</BuildRid>
414

@@ -7,7 +17,10 @@
717
<TargetRids Condition="'$(TargetRids)' == ''">$(BuildRid)</TargetRids>
818
</PropertyGroup>
919

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

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

1831
<ProjectToBuild Include="$(RepoRoot)playground\**\*.csproj" />
32+
</ItemGroup>
1933

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'" />
34+
<!-- `$(SkipTestProjects)` allows skipping test projects from being
35+
included in the build at all. This is useful for cases like when we are
36+
just building the packages, and don't need to build the test projects. -->
37+
<ItemGroup Condition="'$(SkipManagedBuild)' != 'true' and '$(SkipTestProjects)' != 'true'">
38+
<ProjectToBuild Include="$(RepoRoot)tests\**\*.csproj" />
2439
</ItemGroup>
2540

2641
<!-- Extension build project -->

0 commit comments

Comments
 (0)