From 5c7b5fdf8862bd6bbe57ede81a4bcfb8aea45b99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=F0=9D=90=93=F0=9D=90=9E=F0=9D=90=9A=F0=9D=90=A4?= =?UTF-8?q?=F0=9D=90=A8=F0=9D=90=B0=F0=9D=90=9A?= <27560638+Teakowa@users.noreply.github.com> Date: Mon, 17 Aug 2026 15:42:07 +0800 Subject: [PATCH 1/2] chore(ci): gate Rust and conformance jobs by changed paths --- .github/workflows/ci.yml | 46 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6e577ad..f14760b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,7 +9,51 @@ permissions: contents: read jobs: + changes: + name: Classify changes + runs-on: ubuntu-latest + outputs: + rust: ${{ steps.classify.outputs.rust }} + conformance: ${{ steps.classify.outputs.conformance }} + steps: + - uses: actions/checkout@v7 + with: + fetch-depth: 0 + - name: Classify changed paths + id: classify + shell: bash + env: + EVENT_NAME: ${{ github.event_name }} + PR_BASE_SHA: ${{ github.event.pull_request.base.sha }} + PUSH_BASE_SHA: ${{ github.event.before }} + run: | + set -euo pipefail + if [[ "$EVENT_NAME" == "pull_request" ]]; then + base="$PR_BASE_SHA" + else + base="$PUSH_BASE_SHA" + fi + + if [[ -z "$base" || "$base" =~ ^0+$ ]]; then + echo "rust=true" >> "$GITHUB_OUTPUT" + echo "conformance=true" >> "$GITHUB_OUTPUT" + exit 0 + fi + + files="$(git diff --name-only "$base" "$GITHUB_SHA")" + printf '%s\n' "$files" + + if grep -Eq '^(conformance/|Cargo\.(toml|lock)$|rust-toolchain\.toml$|\.github/workflows/ci\.yml$)' <<< "$files"; then + echo "rust=true" >> "$GITHUB_OUTPUT" + echo "conformance=true" >> "$GITHUB_OUTPUT" + else + echo "rust=false" >> "$GITHUB_OUTPUT" + echo "conformance=false" >> "$GITHUB_OUTPUT" + fi + rust: + needs: changes + if: needs.changes.outputs.rust == 'true' runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 @@ -21,6 +65,8 @@ jobs: run: cargo test --workspace conformance: + needs: changes + if: needs.changes.outputs.conformance == 'true' runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 From 3c65069f77dcae85d7c53611c1780013a5fff49a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=F0=9D=90=93=F0=9D=90=9E=F0=9D=90=9A=F0=9D=90=A4?= =?UTF-8?q?=F0=9D=90=A8=F0=9D=90=B0=F0=9D=90=9A?= <27560638+Teakowa@users.noreply.github.com> Date: Mon, 17 Aug 2026 15:50:41 +0800 Subject: [PATCH 2/2] chore(ci): simplify docs-only filtering --- .github/workflows/ci.yml | 52 +++++----------------------------------- 1 file changed, 6 insertions(+), 46 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f14760b..f58dbe4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,57 +3,19 @@ name: CI on: push: branches: ["main"] + paths-ignore: + - "**/*.md" + - "docs/**" pull_request: + paths-ignore: + - "**/*.md" + - "docs/**" permissions: contents: read jobs: - changes: - name: Classify changes - runs-on: ubuntu-latest - outputs: - rust: ${{ steps.classify.outputs.rust }} - conformance: ${{ steps.classify.outputs.conformance }} - steps: - - uses: actions/checkout@v7 - with: - fetch-depth: 0 - - name: Classify changed paths - id: classify - shell: bash - env: - EVENT_NAME: ${{ github.event_name }} - PR_BASE_SHA: ${{ github.event.pull_request.base.sha }} - PUSH_BASE_SHA: ${{ github.event.before }} - run: | - set -euo pipefail - if [[ "$EVENT_NAME" == "pull_request" ]]; then - base="$PR_BASE_SHA" - else - base="$PUSH_BASE_SHA" - fi - - if [[ -z "$base" || "$base" =~ ^0+$ ]]; then - echo "rust=true" >> "$GITHUB_OUTPUT" - echo "conformance=true" >> "$GITHUB_OUTPUT" - exit 0 - fi - - files="$(git diff --name-only "$base" "$GITHUB_SHA")" - printf '%s\n' "$files" - - if grep -Eq '^(conformance/|Cargo\.(toml|lock)$|rust-toolchain\.toml$|\.github/workflows/ci\.yml$)' <<< "$files"; then - echo "rust=true" >> "$GITHUB_OUTPUT" - echo "conformance=true" >> "$GITHUB_OUTPUT" - else - echo "rust=false" >> "$GITHUB_OUTPUT" - echo "conformance=false" >> "$GITHUB_OUTPUT" - fi - rust: - needs: changes - if: needs.changes.outputs.rust == 'true' runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 @@ -65,8 +27,6 @@ jobs: run: cargo test --workspace conformance: - needs: changes - if: needs.changes.outputs.conformance == 'true' runs-on: ubuntu-latest steps: - uses: actions/checkout@v7