From bc37417d6ce45a398d9eaf0666f8780670dcf9ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=89=E6=AD=A3=E8=B6=85?= Date: Tue, 8 Jul 2025 21:20:18 +0800 Subject: [PATCH] ci: fix workflows triggering on documentation-only changes (#111) - Fix performance.yml: now ignores *.md, README*, and docs/** - Fix build.yml: now ignores documentation files and images - Fix docker.yml: prevent Docker builds on README changes - Replace 'paths:' with 'paths-ignore:' to properly exclude docs - Reduces unnecessary CI runs for documentation-only PRs This resolves the issue where README changes triggered expensive CI pipelines including Performance Testing and Docker builds. --- .github/workflows/build.yml | 40 ++++++++++++++++++----------- .github/workflows/docker.yml | 42 +++++++++++++++++++------------ .github/workflows/performance.yml | 18 +++++++++---- 3 files changed, 65 insertions(+), 35 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 84bb9d97..9bf808ca 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,22 +18,34 @@ on: push: tags: ["*"] branches: [main] - paths: - - "rustfs/**" - - "cli/**" - - "crates/**" - - "Cargo.toml" - - "Cargo.lock" - - ".github/workflows/build.yml" + paths-ignore: + - "**.md" + - "**.txt" + - "docs/**" + - "deploy/**" + - "scripts/dev_*.sh" + - "LICENSE*" + - "README*" + - "**/*.png" + - "**/*.jpg" + - "**/*.svg" + - ".gitignore" + - ".dockerignore" pull_request: branches: [main] - paths: - - "rustfs/**" - - "cli/**" - - "crates/**" - - "Cargo.toml" - - "Cargo.lock" - - ".github/workflows/build.yml" + paths-ignore: + - "**.md" + - "**.txt" + - "docs/**" + - "deploy/**" + - "scripts/dev_*.sh" + - "LICENSE*" + - "README*" + - "**/*.png" + - "**/*.jpg" + - "**/*.svg" + - ".gitignore" + - ".dockerignore" schedule: - cron: "0 0 * * 0" # Weekly on Sunday at midnight UTC workflow_dispatch: diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 3a900bb5..a8172ca9 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -18,24 +18,34 @@ on: push: tags: ["*"] branches: [main] - paths: - - "rustfs/**" - - "crates/**" - - "Dockerfile*" - - ".docker/**" - - "Cargo.toml" - - "Cargo.lock" - - ".github/workflows/docker.yml" + paths-ignore: + - "**.md" + - "**.txt" + - "docs/**" + - "deploy/**" + - "scripts/dev_*.sh" + - "LICENSE*" + - "README*" + - "**/*.png" + - "**/*.jpg" + - "**/*.svg" + - ".gitignore" + - ".dockerignore" pull_request: branches: [main] - paths: - - "rustfs/**" - - "crates/**" - - "Dockerfile*" - - ".docker/**" - - "Cargo.toml" - - "Cargo.lock" - - ".github/workflows/docker.yml" + paths-ignore: + - "**.md" + - "**.txt" + - "docs/**" + - "deploy/**" + - "scripts/dev_*.sh" + - "LICENSE*" + - "README*" + - "**/*.png" + - "**/*.jpg" + - "**/*.svg" + - ".gitignore" + - ".dockerignore" workflow_dispatch: inputs: push_images: diff --git a/.github/workflows/performance.yml b/.github/workflows/performance.yml index 08a8cf48..98a9461d 100644 --- a/.github/workflows/performance.yml +++ b/.github/workflows/performance.yml @@ -17,11 +17,19 @@ name: Performance Testing on: push: branches: [main] - paths: - - "rustfs/**" - - "crates/**" - - "Cargo.toml" - - "Cargo.lock" + paths-ignore: + - "**.md" + - "**.txt" + - "docs/**" + - "deploy/**" + - "scripts/dev_*.sh" + - "LICENSE*" + - "README*" + - "**/*.png" + - "**/*.jpg" + - "**/*.svg" + - ".gitignore" + - ".dockerignore" workflow_dispatch: inputs: profile_duration: