run_tests.yml

  1# Generated from xtask::workflows::run_tests
  2# Rebuild with `cargo xtask workflows`.
  3name: run_tests
  4env:
  5  CARGO_TERM_COLOR: always
  6  RUST_BACKTRACE: '1'
  7  CARGO_INCREMENTAL: '0'
  8on:
  9  pull_request:
 10    branches:
 11    - '**'
 12  push:
 13    branches:
 14    - main
 15    - v[0-9]+.[0-9]+.x
 16jobs:
 17  orchestrate:
 18    if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
 19    runs-on: namespace-profile-2x4-ubuntu-2404
 20    steps:
 21    - name: steps::checkout_repo
 22      uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
 23      with:
 24        clean: false
 25        fetch-depth: ${{ github.ref == 'refs/heads/main' && 2 || 350 }}
 26    - id: filter
 27      name: filter
 28      run: |
 29        set -euo pipefail
 30        if [ -z "$GITHUB_BASE_REF" ]; then
 31          echo "Not in a PR context (i.e., push to main/stable/preview)"
 32          COMPARE_REV="$(git rev-parse HEAD~1)"
 33        else
 34          echo "In a PR context comparing to pull_request.base.ref"
 35          git fetch origin "$GITHUB_BASE_REF" --depth=350
 36          COMPARE_REV="$(git merge-base "origin/${GITHUB_BASE_REF}" HEAD)"
 37        fi
 38        CHANGED_FILES="$(git diff --name-only "$COMPARE_REV" ${{ github.sha }})"
 39
 40        check_pattern() {
 41          local output_name="$1"
 42          local pattern="$2"
 43          local grep_arg="$3"
 44
 45          echo "$CHANGED_FILES" | grep "$grep_arg" "$pattern" && \
 46            echo "${output_name}=true" >> "$GITHUB_OUTPUT" || \
 47            echo "${output_name}=false" >> "$GITHUB_OUTPUT"
 48        }
 49
 50        # Check for changes that require full rebuild (no filter)
 51        # Direct pushes to main/stable/preview always run full suite
 52        if [ -z "$GITHUB_BASE_REF" ]; then
 53          echo "Not a PR, running full test suite"
 54          echo "changed_packages=" >> "$GITHUB_OUTPUT"
 55        elif echo "$CHANGED_FILES" | grep -qP '^(rust-toolchain\.toml|\.cargo/|\.github/|Cargo\.(toml|lock)$)'; then
 56          echo "Toolchain, cargo config, or root Cargo files changed, will run all tests"
 57          echo "changed_packages=" >> "$GITHUB_OUTPUT"
 58        else
 59          # Extract changed directories from file paths
 60          CHANGED_DIRS=$(echo "$CHANGED_FILES" | \
 61            grep -oP '^(crates|tooling)/\K[^/]+' | \
 62            sort -u || true)
 63
 64          # Build directory-to-package mapping using cargo metadata
 65          DIR_TO_PKG=$(cargo metadata --format-version=1 --no-deps 2>/dev/null | \
 66            jq -r '.packages[] | select(.manifest_path | test("crates/|tooling/")) | "\(.manifest_path | capture("(crates|tooling)/(?<dir>[^/]+)") | .dir)=\(.name)"')
 67
 68          # Map directory names to package names
 69          FILE_CHANGED_PKGS=""
 70          for dir in $CHANGED_DIRS; do
 71            pkg=$(echo "$DIR_TO_PKG" | grep "^${dir}=" | cut -d= -f2 | head -1)
 72            if [ -n "$pkg" ]; then
 73              FILE_CHANGED_PKGS=$(printf '%s\n%s' "$FILE_CHANGED_PKGS" "$pkg")
 74            else
 75              # Fall back to directory name if no mapping found
 76              FILE_CHANGED_PKGS=$(printf '%s\n%s' "$FILE_CHANGED_PKGS" "$dir")
 77            fi
 78          done
 79          FILE_CHANGED_PKGS=$(echo "$FILE_CHANGED_PKGS" | grep -v '^$' | sort -u || true)
 80
 81          # If assets/ changed, add crates that depend on those assets
 82          if echo "$CHANGED_FILES" | grep -qP '^assets/'; then
 83            FILE_CHANGED_PKGS=$(printf '%s\n%s\n%s\n%s' "$FILE_CHANGED_PKGS" "settings" "storybook" "assets" | sort -u)
 84          fi
 85
 86          # Combine all changed packages
 87          ALL_CHANGED_PKGS=$(echo "$FILE_CHANGED_PKGS" | grep -v '^$' || true)
 88
 89          if [ -z "$ALL_CHANGED_PKGS" ]; then
 90            echo "No package changes detected, will run all tests"
 91            echo "changed_packages=" >> "$GITHUB_OUTPUT"
 92          else
 93            # Build nextest filterset with rdeps for each package
 94            FILTERSET=$(echo "$ALL_CHANGED_PKGS" | \
 95              sed 's/.*/rdeps(&)/' | \
 96              tr '\n' '|' | \
 97              sed 's/|$//')
 98            echo "Changed packages filterset: $FILTERSET"
 99            echo "changed_packages=$FILTERSET" >> "$GITHUB_OUTPUT"
100          fi
101        fi
102
103        check_pattern "run_action_checks" '^\.github/(workflows/|actions/|actionlint.yml)|tooling/xtask|script/' -qP
104        check_pattern "run_docs" '^(docs/|crates/.*\.rs)' -qP
105        check_pattern "run_licenses" '^(Cargo.lock|script/.*licenses)' -qP
106        check_pattern "run_tests" '^(docs/|script/update_top_ranking_issues/|\.github/(ISSUE_TEMPLATE|workflows/(?!run_tests)))' -qvP
107    outputs:
108      changed_packages: ${{ steps.filter.outputs.changed_packages }}
109      run_action_checks: ${{ steps.filter.outputs.run_action_checks }}
110      run_docs: ${{ steps.filter.outputs.run_docs }}
111      run_licenses: ${{ steps.filter.outputs.run_licenses }}
112      run_tests: ${{ steps.filter.outputs.run_tests }}
113  check_style:
114    if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
115    runs-on: namespace-profile-4x8-ubuntu-2204
116    steps:
117    - name: steps::checkout_repo
118      uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
119      with:
120        clean: false
121    - name: steps::cache_rust_dependencies_namespace
122      uses: namespacelabs/nscloud-cache-action@v1
123      with:
124        cache: rust
125        path: ~/.rustup
126    - name: steps::setup_pnpm
127      uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2
128      with:
129        version: '9'
130    - name: steps::prettier
131      run: ./script/prettier
132    - name: steps::cargo_fmt
133      run: cargo fmt --all -- --check
134    - name: ./script/check-todos
135      run: ./script/check-todos
136    - name: ./script/check-keymaps
137      run: ./script/check-keymaps
138    - name: run_tests::check_style::check_for_typos
139      uses: crate-ci/typos@2d0ce569feab1f8752f1dde43cc2f2aa53236e06
140      with:
141        config: ./typos.toml
142    timeout-minutes: 60
143  clippy_windows:
144    needs:
145    - orchestrate
146    if: needs.orchestrate.outputs.run_tests == 'true'
147    runs-on: self-32vcpu-windows-2022
148    steps:
149    - name: steps::checkout_repo
150      uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
151      with:
152        clean: false
153    - name: steps::setup_cargo_config
154      run: |
155        New-Item -ItemType Directory -Path "./../.cargo" -Force
156        Copy-Item -Path "./.cargo/ci-config.toml" -Destination "./../.cargo/config.toml"
157      shell: pwsh
158    - name: steps::setup_sccache
159      run: ./script/setup-sccache.ps1
160      shell: pwsh
161      env:
162        R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID }}
163        R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
164        R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
165        SCCACHE_BUCKET: sccache-zed
166    - name: steps::clippy
167      run: ./script/clippy.ps1
168      shell: pwsh
169    - name: steps::show_sccache_stats
170      run: if ($env:RUSTC_WRAPPER) { & $env:RUSTC_WRAPPER --show-stats }; exit 0
171      shell: pwsh
172    timeout-minutes: 60
173  clippy_linux:
174    needs:
175    - orchestrate
176    if: needs.orchestrate.outputs.run_tests == 'true'
177    runs-on: namespace-profile-16x32-ubuntu-2204
178    steps:
179    - name: steps::checkout_repo
180      uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
181      with:
182        clean: false
183    - name: steps::setup_cargo_config
184      run: |
185        mkdir -p ./../.cargo
186        cp ./.cargo/ci-config.toml ./../.cargo/config.toml
187    - name: steps::cache_rust_dependencies_namespace
188      uses: namespacelabs/nscloud-cache-action@v1
189      with:
190        cache: rust
191        path: ~/.rustup
192    - name: steps::setup_linux
193      run: ./script/linux
194    - name: steps::install_mold
195      run: ./script/install-mold
196    - name: steps::download_wasi_sdk
197      run: ./script/download-wasi-sdk
198    - name: steps::setup_sccache
199      run: ./script/setup-sccache
200      env:
201        R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID }}
202        R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
203        R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
204        SCCACHE_BUCKET: sccache-zed
205    - name: steps::clippy
206      run: ./script/clippy
207    - name: steps::show_sccache_stats
208      run: sccache --show-stats || true
209    timeout-minutes: 60
210  clippy_mac:
211    needs:
212    - orchestrate
213    if: needs.orchestrate.outputs.run_tests == 'true'
214    runs-on: namespace-profile-mac-large
215    steps:
216    - name: steps::checkout_repo
217      uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
218      with:
219        clean: false
220    - name: steps::setup_cargo_config
221      run: |
222        mkdir -p ./../.cargo
223        cp ./.cargo/ci-config.toml ./../.cargo/config.toml
224    - name: steps::cache_rust_dependencies_namespace
225      uses: namespacelabs/nscloud-cache-action@v1
226      with:
227        cache: rust
228        path: ~/.rustup
229    - name: steps::setup_sccache
230      run: ./script/setup-sccache
231      env:
232        R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID }}
233        R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
234        R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
235        SCCACHE_BUCKET: sccache-zed
236    - name: steps::clippy
237      run: ./script/clippy
238    - name: steps::show_sccache_stats
239      run: sccache --show-stats || true
240    timeout-minutes: 60
241  run_tests_windows:
242    needs:
243    - orchestrate
244    if: needs.orchestrate.outputs.run_tests == 'true'
245    runs-on: self-32vcpu-windows-2022
246    steps:
247    - name: steps::checkout_repo
248      uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
249      with:
250        clean: false
251    - name: steps::setup_cargo_config
252      run: |
253        New-Item -ItemType Directory -Path "./../.cargo" -Force
254        Copy-Item -Path "./.cargo/ci-config.toml" -Destination "./../.cargo/config.toml"
255      shell: pwsh
256    - name: steps::setup_node
257      uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
258      with:
259        node-version: '20'
260    - name: steps::clear_target_dir_if_large
261      run: ./script/clear-target-dir-if-larger-than.ps1 250
262      shell: pwsh
263    - name: steps::setup_sccache
264      run: ./script/setup-sccache.ps1
265      shell: pwsh
266      env:
267        R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID }}
268        R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
269        R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
270        SCCACHE_BUCKET: sccache-zed
271    - name: steps::cargo_nextest
272      run: cargo nextest run --workspace --no-fail-fast --no-tests=warn${{ needs.orchestrate.outputs.changed_packages && format(' -E "{0}"', needs.orchestrate.outputs.changed_packages) || '' }}
273      shell: pwsh
274    - name: steps::show_sccache_stats
275      run: if ($env:RUSTC_WRAPPER) { & $env:RUSTC_WRAPPER --show-stats }; exit 0
276      shell: pwsh
277    - name: steps::cleanup_cargo_config
278      if: always()
279      run: |
280        Remove-Item -Recurse -Path "./../.cargo" -Force -ErrorAction SilentlyContinue
281      shell: pwsh
282    timeout-minutes: 60
283  run_tests_linux:
284    needs:
285    - orchestrate
286    if: needs.orchestrate.outputs.run_tests == 'true'
287    runs-on: namespace-profile-16x32-ubuntu-2204
288    steps:
289    - name: steps::checkout_repo
290      uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
291      with:
292        clean: false
293    - name: steps::setup_cargo_config
294      run: |
295        mkdir -p ./../.cargo
296        cp ./.cargo/ci-config.toml ./../.cargo/config.toml
297    - name: steps::cache_rust_dependencies_namespace
298      uses: namespacelabs/nscloud-cache-action@v1
299      with:
300        cache: rust
301        path: ~/.rustup
302    - name: steps::setup_linux
303      run: ./script/linux
304    - name: steps::install_mold
305      run: ./script/install-mold
306    - name: steps::download_wasi_sdk
307      run: ./script/download-wasi-sdk
308    - name: steps::setup_node
309      uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
310      with:
311        node-version: '20'
312    - name: steps::cargo_install_nextest
313      uses: taiki-e/install-action@nextest
314    - name: steps::clear_target_dir_if_large
315      run: ./script/clear-target-dir-if-larger-than 250
316    - name: steps::setup_sccache
317      run: ./script/setup-sccache
318      env:
319        R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID }}
320        R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
321        R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
322        SCCACHE_BUCKET: sccache-zed
323    - name: steps::cargo_nextest
324      run: cargo nextest run --workspace --no-fail-fast --no-tests=warn${{ needs.orchestrate.outputs.changed_packages && format(' -E "{0}"', needs.orchestrate.outputs.changed_packages) || '' }}
325    - name: steps::show_sccache_stats
326      run: sccache --show-stats || true
327    - name: steps::cleanup_cargo_config
328      if: always()
329      run: |
330        rm -rf ./../.cargo
331    timeout-minutes: 60
332    services:
333      postgres:
334        image: postgres:15
335        env:
336          POSTGRES_HOST_AUTH_METHOD: trust
337        ports:
338        - 5432:5432
339        options: --health-cmd pg_isready --health-interval 500ms --health-timeout 5s --health-retries 10
340  run_tests_mac:
341    needs:
342    - orchestrate
343    if: needs.orchestrate.outputs.run_tests == 'true'
344    runs-on: namespace-profile-mac-large
345    steps:
346    - name: steps::checkout_repo
347      uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
348      with:
349        clean: false
350    - name: steps::setup_cargo_config
351      run: |
352        mkdir -p ./../.cargo
353        cp ./.cargo/ci-config.toml ./../.cargo/config.toml
354    - name: steps::cache_rust_dependencies_namespace
355      uses: namespacelabs/nscloud-cache-action@v1
356      with:
357        cache: rust
358        path: ~/.rustup
359    - name: steps::setup_node
360      uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
361      with:
362        node-version: '20'
363    - name: steps::cargo_install_nextest
364      uses: taiki-e/install-action@nextest
365    - name: steps::clear_target_dir_if_large
366      run: ./script/clear-target-dir-if-larger-than 300
367    - name: steps::setup_sccache
368      run: ./script/setup-sccache
369      env:
370        R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID }}
371        R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
372        R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
373        SCCACHE_BUCKET: sccache-zed
374    - name: steps::cargo_nextest
375      run: cargo nextest run --workspace --no-fail-fast --no-tests=warn${{ needs.orchestrate.outputs.changed_packages && format(' -E "{0}"', needs.orchestrate.outputs.changed_packages) || '' }}
376    - name: steps::show_sccache_stats
377      run: sccache --show-stats || true
378    - name: steps::cleanup_cargo_config
379      if: always()
380      run: |
381        rm -rf ./../.cargo
382    timeout-minutes: 60
383  doctests:
384    needs:
385    - orchestrate
386    if: needs.orchestrate.outputs.run_tests == 'true'
387    runs-on: namespace-profile-16x32-ubuntu-2204
388    steps:
389    - name: steps::checkout_repo
390      uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
391      with:
392        clean: false
393    - name: steps::cache_rust_dependencies_namespace
394      uses: namespacelabs/nscloud-cache-action@v1
395      with:
396        cache: rust
397        path: ~/.rustup
398    - name: steps::setup_linux
399      run: ./script/linux
400    - name: steps::install_mold
401      run: ./script/install-mold
402    - name: steps::download_wasi_sdk
403      run: ./script/download-wasi-sdk
404    - name: steps::setup_cargo_config
405      run: |
406        mkdir -p ./../.cargo
407        cp ./.cargo/ci-config.toml ./../.cargo/config.toml
408    - name: steps::setup_sccache
409      run: ./script/setup-sccache
410      env:
411        R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID }}
412        R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
413        R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
414        SCCACHE_BUCKET: sccache-zed
415    - id: run_doctests
416      name: run_tests::doctests::run_doctests
417      run: |
418        cargo test --workspace --doc --no-fail-fast
419    - name: steps::show_sccache_stats
420      run: sccache --show-stats || true
421    - name: steps::cleanup_cargo_config
422      if: always()
423      run: |
424        rm -rf ./../.cargo
425    timeout-minutes: 60
426  check_workspace_binaries:
427    needs:
428    - orchestrate
429    if: needs.orchestrate.outputs.run_tests == 'true'
430    runs-on: namespace-profile-8x16-ubuntu-2204
431    steps:
432    - name: steps::checkout_repo
433      uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
434      with:
435        clean: false
436    - name: steps::setup_cargo_config
437      run: |
438        mkdir -p ./../.cargo
439        cp ./.cargo/ci-config.toml ./../.cargo/config.toml
440    - name: steps::cache_rust_dependencies_namespace
441      uses: namespacelabs/nscloud-cache-action@v1
442      with:
443        cache: rust
444        path: ~/.rustup
445    - name: steps::setup_linux
446      run: ./script/linux
447    - name: steps::install_mold
448      run: ./script/install-mold
449    - name: steps::download_wasi_sdk
450      run: ./script/download-wasi-sdk
451    - name: steps::setup_sccache
452      run: ./script/setup-sccache
453      env:
454        R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID }}
455        R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
456        R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
457        SCCACHE_BUCKET: sccache-zed
458    - name: cargo build -p collab
459      run: cargo build -p collab
460    - name: cargo build --workspace --bins --examples
461      run: cargo build --workspace --bins --examples
462    - name: steps::show_sccache_stats
463      run: sccache --show-stats || true
464    - name: steps::cleanup_cargo_config
465      if: always()
466      run: |
467        rm -rf ./../.cargo
468    timeout-minutes: 60
469  check_dependencies:
470    needs:
471    - orchestrate
472    if: needs.orchestrate.outputs.run_tests == 'true'
473    runs-on: namespace-profile-2x4-ubuntu-2404
474    steps:
475    - name: steps::checkout_repo
476      uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
477      with:
478        clean: false
479    - name: steps::cache_rust_dependencies_namespace
480      uses: namespacelabs/nscloud-cache-action@v1
481      with:
482        cache: rust
483        path: ~/.rustup
484    - name: run_tests::check_dependencies::install_cargo_machete
485      uses: clechasseur/rs-cargo@8435b10f6e71c2e3d4d3b7573003a8ce4bfc6386
486      with:
487        command: install
488        args: cargo-machete@0.7.0
489    - name: run_tests::check_dependencies::run_cargo_machete
490      uses: clechasseur/rs-cargo@8435b10f6e71c2e3d4d3b7573003a8ce4bfc6386
491      with:
492        command: machete
493    - name: run_tests::check_dependencies::check_cargo_lock
494      run: cargo update --locked --workspace
495    - name: run_tests::check_dependencies::check_vulnerable_dependencies
496      if: github.event_name == 'pull_request'
497      uses: actions/dependency-review-action@67d4f4bd7a9b17a0db54d2a7519187c65e339de8
498      with:
499        license-check: false
500    timeout-minutes: 60
501  check_docs:
502    needs:
503    - orchestrate
504    if: needs.orchestrate.outputs.run_docs == 'true'
505    runs-on: namespace-profile-16x32-ubuntu-2204
506    env:
507      DOCS_AMPLITUDE_API_KEY: ${{ secrets.DOCS_AMPLITUDE_API_KEY }}
508      MDBOOK_BOOK__SITE_URL: /docs/
509      DOCS_CHANNEL: stable
510    steps:
511    - name: steps::checkout_repo
512      uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
513      with:
514        clean: false
515    - name: steps::setup_cargo_config
516      run: |
517        mkdir -p ./../.cargo
518        cp ./.cargo/ci-config.toml ./../.cargo/config.toml
519    - name: steps::cache_rust_dependencies_namespace
520      uses: namespacelabs/nscloud-cache-action@v1
521      with:
522        cache: rust
523        path: ~/.rustup
524    - name: steps::setup_linux
525      run: ./script/linux
526    - name: steps::install_mold
527      run: ./script/install-mold
528    - name: steps::download_wasi_sdk
529      run: ./script/download-wasi-sdk
530    - name: ./script/generate-action-metadata
531      run: ./script/generate-action-metadata
532    - name: deploy_docs::lychee_link_check
533      uses: lycheeverse/lychee-action@82202e5e9c2f4ef1a55a3d02563e1cb6041e5332
534      with:
535        args: --no-progress --exclude '^http' './docs/src/**/*'
536        fail: true
537        jobSummary: false
538    - name: deploy_docs::install_mdbook
539      uses: peaceiris/actions-mdbook@ee69d230fe19748b7abf22df32acaa93833fad08
540      with:
541        mdbook-version: 0.4.37
542    - name: deploy_docs::build_docs_book
543      run: |
544        mkdir -p target/deploy
545        mdbook build ./docs --dest-dir=../target/deploy/docs/
546    - name: deploy_docs::lychee_link_check
547      uses: lycheeverse/lychee-action@82202e5e9c2f4ef1a55a3d02563e1cb6041e5332
548      with:
549        args: --no-progress --exclude '^http' 'target/deploy/docs'
550        fail: true
551        jobSummary: false
552    timeout-minutes: 60
553  check_licenses:
554    needs:
555    - orchestrate
556    if: needs.orchestrate.outputs.run_licenses == 'true'
557    runs-on: namespace-profile-2x4-ubuntu-2404
558    steps:
559    - name: steps::checkout_repo
560      uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
561      with:
562        clean: false
563    - name: steps::cache_rust_dependencies_namespace
564      uses: namespacelabs/nscloud-cache-action@v1
565      with:
566        cache: rust
567        path: ~/.rustup
568    - name: ./script/check-licenses
569      run: ./script/check-licenses
570    - name: ./script/generate-licenses
571      run: ./script/generate-licenses
572  check_scripts:
573    needs:
574    - orchestrate
575    if: needs.orchestrate.outputs.run_action_checks == 'true'
576    runs-on: namespace-profile-2x4-ubuntu-2404
577    steps:
578    - name: steps::checkout_repo
579      uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
580      with:
581        clean: false
582    - name: run_tests::check_scripts::run_shellcheck
583      run: ./script/shellcheck-scripts error
584    - id: get_actionlint
585      name: run_tests::check_scripts::download_actionlint
586      run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
587    - name: run_tests::check_scripts::run_actionlint
588      run: |
589        ${{ steps.get_actionlint.outputs.executable }} -color
590    - name: run_tests::check_scripts::check_xtask_workflows
591      run: |
592        cargo xtask workflows
593        if ! git diff --exit-code .github; then
594          echo "Error: .github directory has uncommitted changes after running 'cargo xtask workflows'"
595          echo "Please run 'cargo xtask workflows' locally and commit the changes"
596          exit 1
597        fi
598    timeout-minutes: 60
599  check_postgres_and_protobuf_migrations:
600    needs:
601    - orchestrate
602    if: needs.orchestrate.outputs.run_tests == 'true'
603    runs-on: namespace-profile-16x32-ubuntu-2204
604    env:
605      GIT_AUTHOR_NAME: Protobuf Action
606      GIT_AUTHOR_EMAIL: ci@zed.dev
607      GIT_COMMITTER_NAME: Protobuf Action
608      GIT_COMMITTER_EMAIL: ci@zed.dev
609    steps:
610    - name: steps::checkout_repo
611      uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
612      with:
613        clean: false
614        fetch-depth: 0
615    - name: run_tests::check_postgres_and_protobuf_migrations::ensure_fresh_merge
616      run: |
617        if [ -z "$GITHUB_BASE_REF" ];
618        then
619          echo "BUF_BASE_BRANCH=$(git merge-base origin/main HEAD)" >> "$GITHUB_ENV"
620        else
621          git checkout -B temp
622          git merge -q "origin/$GITHUB_BASE_REF" -m "merge main into temp"
623          echo "BUF_BASE_BRANCH=$GITHUB_BASE_REF" >> "$GITHUB_ENV"
624        fi
625    - name: run_tests::check_postgres_and_protobuf_migrations::bufbuild_setup_action
626      uses: bufbuild/buf-setup-action@v1
627      with:
628        version: v1.29.0
629        github_token: ${{ secrets.GITHUB_TOKEN }}
630    - name: run_tests::check_postgres_and_protobuf_migrations::bufbuild_breaking_action
631      uses: bufbuild/buf-breaking-action@v1
632      with:
633        input: crates/proto/proto/
634        against: https://github.com/${GITHUB_REPOSITORY}.git#branch=${BUF_BASE_BRANCH},subdir=crates/proto/proto/
635    timeout-minutes: 60
636  tests_pass:
637    needs:
638    - orchestrate
639    - check_style
640    - clippy_windows
641    - clippy_linux
642    - clippy_mac
643    - run_tests_windows
644    - run_tests_linux
645    - run_tests_mac
646    - doctests
647    - check_workspace_binaries
648    - check_dependencies
649    - check_docs
650    - check_licenses
651    - check_scripts
652    if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions') && always()
653    runs-on: namespace-profile-2x4-ubuntu-2404
654    steps:
655    - name: run_tests::tests_pass
656      run: |
657        set +x
658        EXIT_CODE=0
659
660        check_result() {
661          echo "* $1: $2"
662          if [[ "$2" != "skipped" && "$2" != "success" ]]; then EXIT_CODE=1; fi
663        }
664
665        check_result "orchestrate" "${{ needs.orchestrate.result }}"
666        check_result "check_style" "${{ needs.check_style.result }}"
667        check_result "clippy_windows" "${{ needs.clippy_windows.result }}"
668        check_result "clippy_linux" "${{ needs.clippy_linux.result }}"
669        check_result "clippy_mac" "${{ needs.clippy_mac.result }}"
670        check_result "run_tests_windows" "${{ needs.run_tests_windows.result }}"
671        check_result "run_tests_linux" "${{ needs.run_tests_linux.result }}"
672        check_result "run_tests_mac" "${{ needs.run_tests_mac.result }}"
673        check_result "doctests" "${{ needs.doctests.result }}"
674        check_result "check_workspace_binaries" "${{ needs.check_workspace_binaries.result }}"
675        check_result "check_dependencies" "${{ needs.check_dependencies.result }}"
676        check_result "check_docs" "${{ needs.check_docs.result }}"
677        check_result "check_licenses" "${{ needs.check_licenses.result }}"
678        check_result "check_scripts" "${{ needs.check_scripts.result }}"
679
680        exit $EXIT_CODE
681concurrency:
682  group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.ref_name == 'main' && github.sha || 'anysha' }}
683  cancel-in-progress: true
684defaults:
685  run:
686    shell: bash -euxo pipefail {0}