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