mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-05 21:07:43 +00:00
ci: cancel PR workflows on close (#4323)
This commit is contained in:
@@ -16,6 +16,7 @@ name: Fuzz
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [ opened, synchronize, reopened, closed ]
|
||||
paths:
|
||||
- "fuzz/**"
|
||||
- "scripts/fuzz/**"
|
||||
@@ -41,7 +42,7 @@ permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
@@ -50,13 +51,21 @@ env:
|
||||
RUSTFLAGS: "--cfg tokio_unstable -C target-feature=-crt-static"
|
||||
|
||||
jobs:
|
||||
cancel-closed-pr-runs:
|
||||
name: Cancel Closed PR Runs
|
||||
if: github.event_name == 'pull_request' && github.event.action == 'closed'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Explain cancellation run
|
||||
run: echo "PR closed; this run only cancels older runs in the same concurrency group."
|
||||
|
||||
# ──────────────────────────────────────────────────────────────
|
||||
# Phase 1: Build all fuzz harness binaries once.
|
||||
# ──────────────────────────────────────────────────────────────
|
||||
fuzz-build:
|
||||
name: Build Fuzz Harness
|
||||
if: >
|
||||
github.event_name == 'pull_request' ||
|
||||
(github.event_name == 'pull_request' && github.event.action != 'closed') ||
|
||||
github.event_name == 'schedule' ||
|
||||
github.event_name == 'workflow_dispatch'
|
||||
runs-on: sm-standard-4
|
||||
@@ -110,7 +119,7 @@ jobs:
|
||||
name: "Smoke / ${{ matrix.target }}"
|
||||
needs: fuzz-build
|
||||
if: >
|
||||
github.event_name == 'pull_request' ||
|
||||
(github.event_name == 'pull_request' && github.event.action != 'closed') ||
|
||||
(github.event_name == 'workflow_dispatch' &&
|
||||
(github.event.inputs.profile == 'smoke' || github.event.inputs.profile == 'both'))
|
||||
runs-on: sm-standard-4
|
||||
|
||||
Reference in New Issue
Block a user