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