Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions .github/workflows/specialized-test-runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,23 @@ jobs:
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

# We need to build the whole solution, so that we can interrogate each test project
- name: Show disk usage before build
run: |-
df -h
du -sh ${{ github.workspace }}

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

- name: Generate test runsheet
id: generate_tests_matrix
Expand All @@ -59,8 +66,17 @@ jobs:
-c Release
/p:Restore=false
/p:Build=false
/p:InstallBrowsersForPlaywright=false
/bl:${{ github.workspace }}/artifacts/log/Release/runsheet.binlog

- name: Show disk usage after build
if: ${{ always() }}
run: |-
df -h
du -d 1 h ~/.nuget/packages
du -d 1 -h ${{ github.workspace }}
du -d 1 -h ${{ github.workspace }}/artifacts

- name: Upload logs, and test results
if: ${{ always() }}
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
Expand Down
25 changes: 20 additions & 5 deletions eng/Build.props
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
<Project TreatAsLocalProperty="TargetRids">
<!--
Properties:
SkipManagedBuild - if 'true', skips building all managed projects, defaults to 'false'
SkipNativeBuild - if 'true', skips building all native projects, defaults to 'false'
BuildExtension - if 'true', builds the extension project, defaults to 'false'
BuildTestsOnly - if 'true', builds only test projects, defaults to 'false'
SkipTestProjects - if 'true', skips building test projects, defaults to 'false'
TargetRids - colon separated list of RIDs to build native projects for
-->

<PropertyGroup>
<BuildRid>$([System.Runtime.InteropServices.RuntimeInformation]::RuntimeIdentifier)</BuildRid>

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

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

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

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

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

<!-- Extension build project -->
Expand Down
Loading