Skip to content

ci(inspectcode): move to windows-latest to resolve .NET Framework references - #202

Merged
Chris-Wolfgang merged 3 commits into
vNextfrom
fix/inspectcode-runs-on-windows
Jul 24, 2026
Merged

ci(inspectcode): move to windows-latest to resolve .NET Framework references#202
Chris-Wolfgang merged 3 commits into
vNextfrom
fix/inspectcode-runs-on-windows

Conversation

@Chris-Wolfgang

Copy link
Copy Markdown
Owner

Summary

Fan-out of Try-Pattern PR #248. Three changes to the inspectcode: job in .github/workflows/pr.yaml:

  1. runs-on: ubuntu-latestwindows-latest. On Ubuntu, InspectCode failed with 60+ MSB3245 assembly-resolution errors on repos with .NET Framework example projects — the reference assemblies (System, System.Xml.Linq, etc.) aren't present without mono. Windows has them bundled at C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.
  2. Gate step: jqpwsh + ConvertFrom-Json. No dependency on preinstalled utilities beyond PowerShell (native on windows-latest).
  3. Build step: dropped the Linux-compatibility exclusion loop. Windows can build every project natively — a repo-root dotnet restore && dotnet build -c Release is sufficient.

Protected file

This PR only touches .github/workflows/pr.yaml. Detect .NET Projects will fail as expected → admin-bypass required.

Related

  • Try-Pattern PR #247 verified 0 InspectCode findings on windows-latest with the same job configuration.
  • Recommend applying this same patch to the ~20 open chore/add-inspectcode fleet PRs before they land, so they don't need this follow-up.

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings July 14, 2026 01:26
Comment thread .github/workflows/pr.yaml Fixed
Comment thread .github/workflows/pr.yaml Fixed
Comment thread .github/workflows/pr.yaml Fixed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the ReSharper InspectCode GitHub Actions job to run reliably for repositories that include .NET Framework target projects by moving the job to a Windows runner and adjusting related scripting to be Windows-friendly.

Changes:

  • Moved inspectcode job from ubuntu-latest to windows-latest and set defaults.run.shell: bash for consistent scripting.
  • Simplified build to a repo-root dotnet restore + dotnet build -c Release on Windows (dropping the previous Linux compatibility exclusions).
  • Replaced SARIF gating logic from jq to PowerShell (ConvertFrom-Json) for error-level result counting.

Comment thread .github/workflows/pr.yaml Outdated
steps:
- name: Checkout code
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
uses: actions/checkout@v7
Comment thread .github/workflows/pr.yaml Outdated

- name: Setup .NET
uses: actions/setup-dotnet@26b0ec14cb23fa6904739307f278c14f94c95bf1 # v5
uses: actions/setup-dotnet@v5
Comment thread .github/workflows/pr.yaml Outdated
Comment on lines 1397 to 1400
- name: Upload SARIF to Code Scanning
uses: github/codeql-action/upload-sarif@v4
with:
sarif_file: inspect.sarif
Comment thread .github/workflows/pr.yaml Outdated
Comment on lines +1382 to +1385
SLN=$(ls *.slnx 2>/dev/null | head -n1)
if [ -z "$SLN" ]; then
SLN=$(ls *.sln 2>/dev/null | head -n1)
fi
Comment thread .github/workflows/pr.yaml
Comment on lines +1320 to +1324
"Directory.Build.props"
"Directory.Build.targets"
"BannedSymbols.txt"
"*.globalconfig"
"*.ruleset"
@Chris-Wolfgang
Chris-Wolfgang changed the base branch from main to vNext July 24, 2026 15:54
# Conflicts:
#	.github/workflows/pr.yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants