From 4438cf5924ebe6c8fb05b38a2059b5509dda6cad Mon Sep 17 00:00:00 2001 From: Christoph Wille Date: Thu, 11 Jun 2026 11:09:41 +0200 Subject: [PATCH] Build and test ILSpy on Linux and macOS in CI Two new jobs run alongside the Windows matrix: each builds the desktop solution filter on its own OS, runs the headless UI tests there, and packages Release self-contained bundles (zip/deb/rpm on Linux, zipped ILSpy.app on macOS) via the BuildTools packaging scripts. Decompiler tests, NuGet packing, and the Windows installers stay in the Windows job, and neither new job checks out the ILSpy-tests submodule, since that only feeds the decompiler tests. The Windows job is untouched so existing required-status-check names keep working. Assisted-by: Claude:claude-fable-5:Claude Code --- .github/workflows/build-ilspy.yml | 179 ++++++++++++++++++++++++++++++ 1 file changed, 179 insertions(+) diff --git a/.github/workflows/build-ilspy.yml b/.github/workflows/build-ilspy.yml index 3cf646374..f561843e9 100644 --- a/.github/workflows/build-ilspy.yml +++ b/.github/workflows/build-ilspy.yml @@ -259,3 +259,182 @@ jobs: name: ilspycmd dotnet tool (${{ matrix.configuration }}) path: ICSharpCode.ILSpyCmd\bin\Release\ilspycmd*.nupkg if-no-files-found: error + + # Linux and macOS build the desktop solution filter, run the headless UI tests on their + # own platform, and package self-contained Release bundles. Decompiler tests, NuGet + # packing, and all Windows-specific packaging stay in the Windows job above; the + # ILSpy-tests submodule only feeds the decompiler tests, so neither job checks it out. + + Linux: + runs-on: ubuntu-latest + env: + StagingDirectory: buildartifacts + + defaults: + run: + shell: pwsh + + steps: + - run: mkdir -p $env:StagingDirectory + + - uses: actions/checkout@v6 + with: + fetch-depth: 0 + persist-credentials: false + + - uses: actions/setup-dotnet@v5 + with: + dotnet-version: '11.0.x' + dotnet-quality: 'preview' + cache: true + cache-dependency-path: '**/packages.lock.json' + env: + DOTNET_INSTALL_DIR: ${{ runner.temp }}/.dotnet + DOTNET_ROOT: ${{ runner.temp }}/.dotnet + + - name: Get Version + id: version + run: | + ./BuildTools/ghactions-install.ps1 + Get-ChildItem Env: | Where-Object {$_.Name -Match "^ILSPY_"} | %{ echo "$($_.Name)=$($_.Value)" } | Out-File -FilePath $Env:GITHUB_OUTPUT -Encoding utf8 -Append + + - name: Restore the application + run: > + dotnet restore ILSpy.Desktop.slnf + /p:RestoreEnablePackagePruning=false + /p:Configuration=Release + /p:Platform="Any CPU" + + - name: Build + run: > + dotnet build ILSpy.Desktop.slnf --no-restore + -c Release + /p:Platform="Any CPU" /m + + - name: Execute UI tests + run: > + dotnet test --project ILSpy.Tests/ILSpy.Tests.csproj + --configuration Release + --no-build --report-trx + --results-directory test-results + + - name: Upload Test Logs + uses: actions/upload-artifact@v7 + if: success() || failure() + with: + name: test-results-linux + path: 'test-results/*.trx' + + - name: Create Test Report + uses: test-summary/action@v2 + if: always() + with: + paths: "test-results/*.trx" + folded: true + + - name: Publish (linux-x64 self-contained) + run: ./publish.ps1 -Configuration Release -Platform linux + + - name: Package (zip, deb, rpm) + run: ./BuildTools/package-linux.ps1 -Configuration Release -Version "${{ steps.version.outputs.ILSPY_VERSION_NUMBER }}" -StagingDirectory $env:StagingDirectory + + - name: Upload zip build artifact + uses: actions/upload-artifact@v7 + with: + name: ILSpy Linux x64 ${{ steps.version.outputs.ILSPY_VERSION_NUMBER }} (Release) + path: ${{ env.StagingDirectory }}/ILSpy_linux-x64_*.zip + if-no-files-found: error + + - name: Upload deb build artifact + uses: actions/upload-artifact@v7 + with: + name: ILSpy Linux x64 deb ${{ steps.version.outputs.ILSPY_VERSION_NUMBER }} (Release) + path: ${{ env.StagingDirectory }}/*.deb + if-no-files-found: error + + - name: Upload rpm build artifact + uses: actions/upload-artifact@v7 + with: + name: ILSpy Linux x64 rpm ${{ steps.version.outputs.ILSPY_VERSION_NUMBER }} (Release) + path: ${{ env.StagingDirectory }}/*.rpm + if-no-files-found: error + + macOS: + runs-on: macos-15 + env: + StagingDirectory: buildartifacts + + defaults: + run: + shell: pwsh + + steps: + - run: mkdir -p $env:StagingDirectory + + - uses: actions/checkout@v6 + with: + fetch-depth: 0 + persist-credentials: false + + - uses: actions/setup-dotnet@v5 + with: + dotnet-version: '11.0.x' + dotnet-quality: 'preview' + cache: true + cache-dependency-path: '**/packages.lock.json' + env: + DOTNET_INSTALL_DIR: ${{ runner.temp }}/.dotnet + DOTNET_ROOT: ${{ runner.temp }}/.dotnet + + - name: Get Version + id: version + run: | + ./BuildTools/ghactions-install.ps1 + Get-ChildItem Env: | Where-Object {$_.Name -Match "^ILSPY_"} | %{ echo "$($_.Name)=$($_.Value)" } | Out-File -FilePath $Env:GITHUB_OUTPUT -Encoding utf8 -Append + + - name: Restore the application + run: > + dotnet restore ILSpy.Desktop.slnf + /p:RestoreEnablePackagePruning=false + /p:Configuration=Release + /p:Platform="Any CPU" + + - name: Build + run: > + dotnet build ILSpy.Desktop.slnf --no-restore + -c Release + /p:Platform="Any CPU" /m + + - name: Execute UI tests + run: > + dotnet test --project ILSpy.Tests/ILSpy.Tests.csproj + --configuration Release + --no-build --report-trx + --results-directory test-results + + - name: Upload Test Logs + uses: actions/upload-artifact@v7 + if: success() || failure() + with: + name: test-results-macos + path: 'test-results/*.trx' + + - name: Create Test Report + uses: test-summary/action@v2 + if: always() + with: + paths: "test-results/*.trx" + folded: true + + - name: Publish (osx-arm64 self-contained app bundle) + run: ./publish.ps1 -Configuration Release -Platform macos + + - name: Package (zipped ILSpy.app) + run: ./BuildTools/package-macos.ps1 -Configuration Release -Version "${{ steps.version.outputs.ILSPY_VERSION_NUMBER }}" -StagingDirectory $env:StagingDirectory + + - name: Upload app bundle build artifact + uses: actions/upload-artifact@v7 + with: + name: ILSpy macOS arm64 ${{ steps.version.outputs.ILSPY_VERSION_NUMBER }} (Release) + path: ${{ env.StagingDirectory }}/ILSpy_macos-arm64_*.zip + if-no-files-found: error