Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
8 changes: 8 additions & 0 deletions .github/workflows/build-frontends.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,15 @@ permissions:
contents: read

jobs:
# Skip push builds for branches whose open PR already builds them; see pr-build-gate.yml.
gate:
permissions:
pull-requests: read
uses: ./.github/workflows/pr-build-gate.yml

build:
needs: gate
if: needs.gate.outputs.run == 'true'
runs-on: ubuntu-latest

steps:
Expand Down
27 changes: 20 additions & 7 deletions .github/workflows/build-ilspy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,16 @@ env:
StagingDirectory: buildartifacts

jobs:
# Skip push builds for branches whose open PR already builds them; see pr-build-gate.yml.
Gate:
permissions:
pull-requests: read
uses: ./.github/workflows/pr-build-gate.yml

Build:
name: Desktop (Windows)
needs: Gate
if: needs.Gate.outputs.run == 'true'
permissions:
packages: write # for dotnet nuget push
runs-on: windows-2025-vs2026
Expand Down Expand Up @@ -274,15 +282,19 @@ jobs:
path: ICSharpCode.ILSpyCmd\bin\Release\ilspycmd*.nupkg
if-no-files-found: error

# Linux and macOS build the desktop solution filter, run the UI and decompiler tests on
# their own platform, and package self-contained Release bundles. NuGet packing and all
# Windows-specific packaging stay in the Windows job above. The decompiler tests need the
# ILSpy-tests submodule (the TargetNet40 configs compile against its legacy reference
# assemblies even on non-Windows); configs that genuinely need Windows (legacy csc, mcs,
# 32-bit, roundtrip) self-exclude via Tester.SupportedOnCurrentPlatform and
# [Platform("Win")]. ILSpy.Tests.Windows runs only in the Windows job by design.
# Linux and macOS build the desktop solution filter, run the UI tests on their own
# platform, and package self-contained Release bundles. NuGet packing and all
# Windows-specific packaging stay in the Windows job above. The decompiler tests run on
# Linux but not macOS (already covered by Windows + Linux; they dominate the runtime of
# the slowest job); they need the ILSpy-tests submodule (the TargetNet40 configs compile
# against its legacy reference assemblies even on non-Windows); configs that genuinely
# need Windows (legacy csc, mcs, 32-bit, roundtrip) self-exclude via
# Tester.SupportedOnCurrentPlatform and [Platform("Win")]. ILSpy.Tests.Windows runs only
# in the Windows job by design.

Desktop:
needs: Gate
if: needs.Gate.outputs.run == 'true'
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -344,6 +356,7 @@ jobs:

- name: Execute decompiler tests
id: decompiler-tests
if: matrix.platform != 'macos'
run: >
dotnet test --project ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj
--configuration Release
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/pr-build-gate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: PR build gate

on:
workflow_call:
outputs:
run:
description: Whether the push-triggered build should run
value: ${{ jobs.gate.outputs.run }}

jobs:
# Skip push builds for branches whose open PR (base master/release/*) already builds
# them via the pull_request trigger. Pushes to master/release/* always build (they
# may publish packages, and no PR of theirs may suppress that).
gate:
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
run: ${{ steps.check.outputs.run }}
steps:
- id: check
env:
GH_TOKEN: ${{ github.token }}
run: |
prs=0
case "$GITHUB_EVENT_NAME/$GITHUB_REF_NAME" in
push/master|push/release/*) ;;
push/*) prs=$(gh api -X GET "repos/$GITHUB_REPOSITORY/pulls" -f state=open \
-f head="$GITHUB_REPOSITORY_OWNER:$GITHUB_REF_NAME" \
--jq 'map(select(.base.ref == "master" or (.base.ref | startswith("release/")))) | length') ;;
esac
echo "run=$([ "$prs" = 0 ] && echo true || echo false)" >> "$GITHUB_OUTPUT"
Loading