From a362a15806f36fd38d8c9d8dfaecb09dacc8a2ac Mon Sep 17 00:00:00 2001 From: Erik Darling <2136037+erikdarlingdata@users.noreply.github.com> Date: Tue, 19 May 2026 21:55:49 -0400 Subject: [PATCH] Skip build/test/publish for documentation-only PRs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A documentation-only change (CHANGELOG, README, etc.) triggered a full ~15-minute compile of Dashboard, Lite, and the Installer for no reason. The paths-filter step now also computes a 'code' output (true when any non-*.md file changed), and the build/test/publish steps are gated on it. Documentation-only PRs and pushes run only checkout + the filter, so the required 'build' check still reports — green — without the workflow being skipped outright. Release builds are unaffected: the filter step does not run on release events, leaving 'code' empty, and the gate (code != 'false') treats an empty value as "run". Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/build.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8c54f30..a9dae59 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -44,8 +44,16 @@ jobs: - 'Installer.Tests/**' - 'install/**' - 'upgrades/**' + # True when any non-documentation file changed. Documentation-only + # changes (e.g. a CHANGELOG or README edit) skip the build/test/ + # publish steps below — there is nothing to compile. The job still + # runs so the required 'build' check reports a result. + code: + - '**' + - '!**/*.md' - name: Setup .NET 10.0 + if: steps.filter.outputs.code != 'false' uses: actions/setup-dotnet@v5 with: dotnet-version: 10.0.x @@ -53,6 +61,7 @@ jobs: cache-dependency-path: '**/packages.lock.json' - name: Restore dependencies + if: steps.filter.outputs.code != 'false' run: | dotnet restore Dashboard/Dashboard.csproj --locked-mode dotnet restore Lite/PerformanceMonitorLite.csproj --locked-mode @@ -61,12 +70,15 @@ jobs: dotnet restore Installer.Tests/Installer.Tests.csproj --locked-mode - name: Build Lite.Tests + if: steps.filter.outputs.code != 'false' run: dotnet build Lite.Tests/Lite.Tests.csproj -c Release --no-restore - name: Build Installer.Tests + if: steps.filter.outputs.code != 'false' run: dotnet build Installer.Tests/Installer.Tests.csproj -c Release --no-restore - name: Run Lite fast tests + if: steps.filter.outputs.code != 'false' run: dotnet test Lite.Tests/Lite.Tests.csproj -c Release --no-build --verbosity normal --filter "FullyQualifiedName!~AnomalyDetectorTests&FullyQualifiedName!~FactCollectorTests&FullyQualifiedName!~FactCollectorMiseryTests&FullyQualifiedName!~BaselineProviderTests&FullyQualifiedName!~InferenceEngineTests&FullyQualifiedName!~ScenarioTests&FullyQualifiedName!~AnalysisServiceTests" - name: Run Lite analysis-heavy tests @@ -78,6 +90,7 @@ jobs: run: dotnet test Installer.Tests/Installer.Tests.csproj -c Release --no-build --verbosity normal --filter "FullyQualifiedName!~VersionDetectionTests&FullyQualifiedName!~IdempotencyTests&FullyQualifiedName!~AdversarialTests" - name: Get version + if: steps.filter.outputs.code != 'false' id: version shell: pwsh run: | @@ -85,6 +98,7 @@ jobs: echo "VERSION=$version" >> $env:GITHUB_OUTPUT - name: Publish Dashboard + if: steps.filter.outputs.code != 'false' run: dotnet publish Dashboard/Dashboard.csproj -c Release -o publish/Dashboard - name: Publish Dashboard (self-contained for Velopack) @@ -92,6 +106,7 @@ jobs: run: dotnet publish Dashboard/Dashboard.csproj -c Release -r win-x64 --self-contained -o publish/Dashboard-velopack - name: Publish Lite + if: steps.filter.outputs.code != 'false' run: dotnet publish Lite/PerformanceMonitorLite.csproj -c Release -o publish/Lite - name: Publish Lite (self-contained for Velopack) @@ -99,6 +114,7 @@ jobs: run: dotnet publish Lite/PerformanceMonitorLite.csproj -c Release -r win-x64 --self-contained -o publish/Lite-velopack - name: Publish CLI Installer + if: steps.filter.outputs.code != 'false' run: dotnet publish Installer/PerformanceMonitorInstaller.csproj -c Release - name: Package release artifacts