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