From 6c13f1a0dcb6d433ff19a6d6abbc0cd41b3b1c27 Mon Sep 17 00:00:00 2001 From: selmankoc Date: Mon, 27 Apr 2026 16:10:23 +0300 Subject: [PATCH 1/2] Update GitHub workflows: enhance build-and-test.yml with concurrency and caching, and disable cancel-workflow.yml --- .github/workflows/build-and-test.yml | 28 ++++++++++++++++++++------- .github/workflows/cancel-workflow.yml | 22 ++++++++++++--------- 2 files changed, 34 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 86df2d8748..8b66f691dc 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -21,6 +21,8 @@ on: - '.github/workflows/build-and-test.yml' pull_request: + branches: + - dev paths: - 'framework/**/*.cs' - 'framework/**/*.cshtml' @@ -42,6 +44,11 @@ on: - synchronize - reopened - ready_for_review + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + permissions: contents: read @@ -51,14 +58,18 @@ jobs: timeout-minutes: 50 if: ${{ !github.event.pull_request.draft }} steps: - - uses: jlumbroso/free-disk-space@main - - uses: PSModule/install-powershell@v1 - with: - Version: latest - - uses: actions/checkout@v2 - - uses: actions/setup-dotnet@master + - uses: jlumbroso/free-disk-space@v1 + - uses: actions/checkout@v4 + - uses: actions/setup-dotnet@v4 with: dotnet-version: 10.0.x + - name: Cache NuGet packages + uses: actions/cache@v4 + with: + path: ~/.nuget/packages + key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', 'Directory.Packages.props') }} + restore-keys: | + ${{ runner.os }}-nuget- - name: Build All run: ./build-all.ps1 working-directory: ./build @@ -70,4 +81,7 @@ jobs: shell: pwsh - name: Codecov - uses: codecov/codecov-action@v2 + uses: codecov/codecov-action@v5 + with: + token: ${{ secrets.CODECOV_TOKEN }} + fail_ci_if_error: true diff --git a/.github/workflows/cancel-workflow.yml b/.github/workflows/cancel-workflow.yml index 039943ad66..1ed3a3bc4b 100644 --- a/.github/workflows/cancel-workflow.yml +++ b/.github/workflows/cancel-workflow.yml @@ -1,17 +1,21 @@ +# This workflow is intentionally disabled. +# Cancellation of redundant runs is now handled natively via the `concurrency` +# block defined in each individual workflow (e.g. build-and-test.yml). +# The styfle/cancel-workflow-action has been archived upstream and is no longer maintained. +# +# To re-enable manual cancellation, change `on: workflow_dispatch` back to `on: [push]` +# and restore the styfle step, but the native `concurrency` approach is preferred. name: cancel-workflow -on: [push] +on: + workflow_dispatch: permissions: contents: read jobs: cancel: - permissions: - actions: write # for styfle/cancel-workflow-action to cancel/stop running workflows - name: 'Cancel Previous Runs' + name: 'Disabled - See file header comment' runs-on: ubuntu-latest - timeout-minutes: 3 + timeout-minutes: 1 steps: - - uses: styfle/cancel-workflow-action@0.6.0 - with: - workflow_id: 10629,1299107,2792859,8268314 - access_token: ${{ github.token }} + - name: No-op + run: echo "Cancellation is handled via concurrency groups in each workflow." From 9af9b865b77ff603fe665b2af8bd8c8a2b63d760 Mon Sep 17 00:00:00 2001 From: selmankoc Date: Mon, 27 Apr 2026 17:21:29 +0300 Subject: [PATCH 2/2] Enhance GitHub workflows: add concurrency settings to angular.yml, build-and-test.yml, codeql-analysis.yml, and image-compression.yml; update cancel-workflow.yml comments Co-authored-by: Copilot --- .github/workflows/angular.yml | 5 +++++ .github/workflows/build-and-test.yml | 7 +++++-- .github/workflows/cancel-workflow.yml | 4 ++-- .github/workflows/codeql-analysis.yml | 4 ++++ .github/workflows/image-compression.yml | 7 +++++-- 5 files changed, 21 insertions(+), 6 deletions(-) diff --git a/.github/workflows/angular.yml b/.github/workflows/angular.yml index cd48c0448a..841a0d944d 100644 --- a/.github/workflows/angular.yml +++ b/.github/workflows/angular.yml @@ -15,6 +15,11 @@ on: - synchronize - reopened - ready_for_review + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + permissions: contents: read diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 8b66f691dc..e2033cf1c3 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -23,6 +23,7 @@ on: pull_request: branches: - dev + - 'rel-*' paths: - 'framework/**/*.cs' - 'framework/**/*.cshtml' @@ -51,6 +52,7 @@ concurrency: permissions: contents: read + id-token: write jobs: build-test: @@ -58,7 +60,7 @@ jobs: timeout-minutes: 50 if: ${{ !github.event.pull_request.draft }} steps: - - uses: jlumbroso/free-disk-space@v1 + - uses: jlumbroso/free-disk-space@v1.3.1 - uses: actions/checkout@v4 - uses: actions/setup-dotnet@v4 with: @@ -81,7 +83,8 @@ jobs: shell: pwsh - name: Codecov + if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }} uses: codecov/codecov-action@v5 with: - token: ${{ secrets.CODECOV_TOKEN }} + use_oidc: true fail_ci_if_error: true diff --git a/.github/workflows/cancel-workflow.yml b/.github/workflows/cancel-workflow.yml index 1ed3a3bc4b..4d868f6b85 100644 --- a/.github/workflows/cancel-workflow.yml +++ b/.github/workflows/cancel-workflow.yml @@ -1,6 +1,6 @@ # This workflow is intentionally disabled. -# Cancellation of redundant runs is now handled natively via the `concurrency` -# block defined in each individual workflow (e.g. build-and-test.yml). +# The workflows that previously depended on this file now handle cancellation +# natively via per-workflow `concurrency` blocks. # The styfle/cancel-workflow-action has been archived upstream and is no longer maintained. # # To re-enable manual cancellation, change `on: workflow_dispatch` back to `on: [push]` diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index d1f6c0c503..16e0443f08 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -29,6 +29,10 @@ on: - reopened - ready_for_review +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + permissions: contents: read diff --git a/.github/workflows/image-compression.yml b/.github/workflows/image-compression.yml index 9eef6db59b..ed4111cdd3 100644 --- a/.github/workflows/image-compression.yml +++ b/.github/workflows/image-compression.yml @@ -12,6 +12,11 @@ on: - synchronize - reopened - ready_for_review + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: build: if: github.event.pull_request.head.repo.full_name == github.repository && !github.event.pull_request.draft @@ -23,5 +28,3 @@ jobs: - name: Compress Images uses: calibreapp/image-actions@main - with: - githubToken: ${{ secrets.GITHUB_TOKEN }}