Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
ci: Run required status checks for docs-only PRs, but exit early (#22254)
Marshall Bowers3d3d8f20eb24
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlindex 29a3c9131a6..1f48c529b8e 100644--- a/.github/workflows/ci.yml+++ b/.github/workflows/ci.yml@@ -7,14 +7,9 @@ on:- "v[0-9]+.[0-9]+.x"tags:- "v*"- paths-ignore:- - "docs/**"pull_request:branches:- "**"- paths-ignore:- - "docs/**/*"- - ".github/workflows/community_*"merge_group:concurrency:@@ -29,6 +24,23 @@ env:RUSTFLAGS: "-D warnings"jobs:+ check_docs_only:+ runs-on: ubuntu-latest+ outputs:+ docs_only: ${{ steps.check_changes.outputs.docs_only }}+ steps:+ - uses: actions/checkout@v4+ with:+ fetch-depth: 0+ - name: Check for non-docs changes+ id: check_changes+ run: |+ if git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep -qvE '^docs/'; then+ echo "docs_only=false" >> $GITHUB_OUTPUT+ else+ echo "docs_only=true" >> $GITHUB_OUTPUT+ fi+migration_checks:name: Check Postgres and Protobuf migrations, mergabilityif: github.repository_owner == 'zed-industries'@@ -97,12 +109,19 @@ jobs:runs-on:- self-hosted- test+ needs: check_docs_onlysteps:- name: Checkout repouses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4with:clean: false+ - name: Skip for docs-only changes+ if: needs.check_docs_only.outputs.docs_only == 'true'+ run: |+ echo "Skipping for docs-only changes"+ exit 0+- name: cargo clippyrun: ./script/clippy@@ -140,6 +159,7 @@ jobs:if: github.repository_owner == 'zed-industries'runs-on:- buildjet-16vcpu-ubuntu-2204+ needs: check_docs_onlysteps:- name: Add Rust to the PATHrun: echo "$HOME/.cargo/bin" >> $GITHUB_PATH@@ -149,6 +169,12 @@ jobs:with:clean: false+ - name: Skip for docs-only changes+ if: needs.check_docs_only.outputs.docs_only == 'true'+ run: |+ echo "Skipping for docs-only changes"+ exit 0+- name: Cache dependenciesuses: swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2with:@@ -175,6 +201,7 @@ jobs:if: github.repository_owner == 'zed-industries'runs-on:- buildjet-16vcpu-ubuntu-2204+ needs: check_docs_onlysteps:- name: Add Rust to the PATHrun: echo "$HOME/.cargo/bin" >> $GITHUB_PATH@@ -184,6 +211,12 @@ jobs:with:clean: false+ - name: Skip for docs-only changes+ if: needs.check_docs_only.outputs.docs_only == 'true'+ run: |+ echo "Skipping for docs-only changes"+ exit 0+- name: Cache dependenciesuses: swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2with:@@ -202,6 +235,7 @@ jobs:name: (Windows) Run Clippy and testsif: github.repository_owner == 'zed-industries'runs-on: hosted-windows-1+ needs: check_docs_onlysteps:# more info here:- https://github.com/rust-lang/cargo/issues/13020- name: Enable longer pathnames for git@@ -211,6 +245,12 @@ jobs:with:clean: false+ - name: Skip for docs-only changes+ if: needs.check_docs_only.outputs.docs_only == 'true'+ run: |+ echo "Skipping for docs-only changes"+ exit 0+- name: Cache dependenciesuses: swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2with: