From 429bf57c94818fda8bd979c394c2767d2b201c94 Mon Sep 17 00:00:00 2001 From: Ken VanDine Date: Mon, 1 Jun 2026 07:41:33 -0400 Subject: [PATCH] ci: validate release build on pull requests Add a pull_request trigger to build.yml so the release build is validated on PRs, mirroring lemonade-sdk/llama.cpp. The pack/upload and release jobs remain gated on schedule/create_release, so nothing is published on a PR run. Scope the trigger to the workflow file itself: the build jobs clone source from upstream (leejet/stable-diffusion.cpp), so only changes to this workflow can affect a PR run's outcome. On PRs, the CUDA matrices build a single representative arch (sm_89) instead of all seven; packaging logic is identical across sm_*, and the full matrix still runs on schedule/dispatch. Co-Authored-By: Claude Opus 4.8 --- .github/workflows/build.yml | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fccb398ec..aa7ec83f3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,6 +9,12 @@ on: description: "Create new release" required: true type: boolean + pull_request: # validate the release build on PRs; the release job is skipped so nothing is published + paths: + # The build jobs clone stable-diffusion.cpp source from upstream + # (leejet/stable-diffusion.cpp), so only changes to this workflow itself + # can affect the outcome of a PR run. Scope PR runs to it. + - '.github/workflows/build.yml' env: BRANCH_NAME: master @@ -101,14 +107,9 @@ jobs: strategy: fail-fast: false matrix: - include: - - sm: sm_75 - - sm: sm_80 - - sm: sm_86 - - sm: sm_89 - - sm: sm_90 - - sm: sm_100 - - sm: sm_120 + # On PRs only build one representative arch (packaging logic is identical + # across all sm_*); build the full matrix on schedule/dispatch. + sm: ${{ github.event_name == 'pull_request' && fromJSON('["sm_89"]') || fromJSON('["sm_75", "sm_80", "sm_86", "sm_89", "sm_90", "sm_100", "sm_120"]') }} steps: - name: Clone @@ -202,14 +203,9 @@ jobs: strategy: fail-fast: false matrix: - include: - - sm: sm_75 - - sm: sm_80 - - sm: sm_86 - - sm: sm_89 - - sm: sm_90 - - sm: sm_100 - - sm: sm_120 + # On PRs only build one representative arch (packaging logic is identical + # across all sm_*); build the full matrix on schedule/dispatch. + sm: ${{ github.event_name == 'pull_request' && fromJSON('["sm_89"]') || fromJSON('["sm_75", "sm_80", "sm_86", "sm_89", "sm_90", "sm_100", "sm_120"]') }} steps: - name: Clone