Skip to content

Commit 3e41280

Browse files
committed
Updated build.yml to run incremental component check before uno-check, dotnet restore and msbuild setup.
Since our incremental component checks use pwsh instead of msbuild, we can save an addition 4-6 minutes of CI time by skipping these steps.
1 parent 9c7900f commit 3e41280

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

.github/workflows/build.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,21 @@ jobs:
107107
with:
108108
submodules: recursive
109109
fetch-depth: 0
110+
111+
- name: Get changed components
112+
run: |
113+
$changedComponents = $(./tooling/Get-Changed-Components.ps1 ${{ github.event.before }} ${{ github.event.after }})
114+
$buildableChangedComponents = $(./tooling/MultiTarget/Filter-Supported-Components.ps1 -Components $changedComponents -MultiTargets ${{ matrix.multitarget }} -WinUIMajorVersion ${{ matrix.winui }})
115+
echo "CHANGED_COMPONENTS_LIST=$(($buildableChangedComponents | ForEach-Object { "$_" }) -join ',')" >> $env:GITHUB_ENV
116+
echo "HAS_BUILDABLE_COMPONENTS=$($buildableChangedComponents.Count -gt 0)" >> $env:GITHUB_ENV
110117
111118
# Restore Tools from Manifest list in the Repository
112119
- name: Restore dotnet tools
120+
if: ${{ env.HAS_BUILDABLE_COMPONENTS == 'true' }}
113121
run: dotnet tool restore
114122

115123
- name: Run Uno Check to Install Dependencies
116-
if: ${{ matrix.multitarget != 'wasdk' && matrix.multitarget != 'linuxgtk' && matrix.multitarget != 'wpf' }}
124+
if: ${{ matrix.multitarget != 'wasdk' && matrix.multitarget != 'linuxgtk' && matrix.multitarget != 'wpf' && env.HAS_BUILDABLE_COMPONENTS == 'true' }}
117125
run: >
118126
dotnet tool run uno-check
119127
--ci
@@ -127,15 +135,9 @@ jobs:
127135
128136
- name: Add msbuild to PATH
129137
uses: microsoft/setup-msbuild@v2
138+
if: ${{ env.HAS_BUILDABLE_COMPONENTS == 'true' }}
130139
with:
131140
vs-version: '[17.9,)'
132-
# Get changed components
133-
- name: Get changed components
134-
run: |
135-
$changedComponents = $(./tooling/Get-Changed-Components.ps1 ${{ github.event.before }} ${{ github.event.after }})
136-
$buildableChangedComponents = $(./tooling/MultiTarget/Filter-Supported-Components.ps1 -Components $changedComponents -MultiTargets ${{ matrix.multitarget }} -WinUIMajorVersion ${{ matrix.winui }})
137-
echo "CHANGED_COMPONENTS_LIST=$(($buildableChangedComponents | ForEach-Object { "$_" }) -join ',')" >> $env:GITHUB_ENV
138-
echo "HAS_BUILDABLE_COMPONENTS=$($buildableChangedComponents.Count -gt 0)" >> $env:GITHUB_ENV
139141

140142
# Generate full solution with all projects (sample gallery heads, components, tests)
141143
- name: Generate solution with ${{ matrix.multitarget }} gallery, components and tests

0 commit comments

Comments
 (0)