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        path: ~/.rustup
272    - name: steps::setup_node
273      uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
274      with:
275        node-version: '20'
276    - name: steps::cargo_install_nextest
277      uses: taiki-e/install-action@nextest
278    - name: steps::clear_target_dir_if_large
279      run: ./script/clear-target-dir-if-larger-than 300
280      shell: bash -euxo pipefail {0}
281    - name: steps::cargo_nextest
282      run: cargo nextest run --workspace --no-fail-fast
283      shell: bash -euxo pipefail {0}
284    - name: steps::cleanup_cargo_config
285      if: always()
286      run: |
287        rm -rf ./../.cargo
288      shell: bash -euxo pipefail {0}
289    timeout-minutes: 60
290  doctests:
291    needs:
292    - orchestrate
293    if: needs.orchestrate.outputs.run_tests == 'true'
294    runs-on: namespace-profile-16x32-ubuntu-2204
295    steps:
296    - name: steps::checkout_repo
297      uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
298      with:
299        clean: false
300    - name: steps::cache_rust_dependencies_namespace
301      uses: namespacelabs/nscloud-cache-action@v1
302      with:
303        cache: rust
304        path: ~/.rustup
305    - name: steps::setup_linux
306      run: ./script/linux
307      shell: bash -euxo pipefail {0}
308    - name: steps::install_mold
309      run: ./script/install-mold
310      shell: bash -euxo pipefail {0}
311    - name: steps::download_wasi_sdk
312      run: ./script/download-wasi-sdk
313      shell: bash -euxo pipefail {0}
314    - name: steps::setup_cargo_config
315      run: |
316        mkdir -p ./../.cargo
317        cp ./.cargo/ci-config.toml ./../.cargo/config.toml
318      shell: bash -euxo pipefail {0}
319    - id: run_doctests
320      name: run_tests::doctests::run_doctests
321      run: |
322        cargo test --workspace --doc --no-fail-fast
323      shell: bash -euxo pipefail {0}
324    - name: steps::cleanup_cargo_config
325      if: always()
326      run: |
327        rm -rf ./../.cargo
328      shell: bash -euxo pipefail {0}
329    timeout-minutes: 60
330  check_workspace_binaries:
331    needs:
332    - orchestrate
333    if: needs.orchestrate.outputs.run_tests == 'true'
334    runs-on: namespace-profile-8x16-ubuntu-2204
335    steps:
336    - name: steps::checkout_repo
337      uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
338      with:
339        clean: false
340    - name: steps::setup_cargo_config
341      run: |
342        mkdir -p ./../.cargo
343        cp ./.cargo/ci-config.toml ./../.cargo/config.toml
344      shell: bash -euxo pipefail {0}
345    - name: steps::cache_rust_dependencies_namespace
346      uses: namespacelabs/nscloud-cache-action@v1
347      with:
348        cache: rust
349        path: ~/.rustup
350    - name: steps::setup_linux
351      run: ./script/linux
352      shell: bash -euxo pipefail {0}
353    - name: steps::install_mold
354      run: ./script/install-mold
355      shell: bash -euxo pipefail {0}
356    - name: steps::download_wasi_sdk
357      run: ./script/download-wasi-sdk
358      shell: bash -euxo pipefail {0}
359    - name: cargo build -p collab
360      run: cargo build -p collab
361      shell: bash -euxo pipefail {0}
362    - name: cargo build --workspace --bins --examples
363      run: cargo build --workspace --bins --examples
364      shell: bash -euxo pipefail {0}
365    - name: steps::cleanup_cargo_config
366      if: always()
367      run: |
368        rm -rf ./../.cargo
369      shell: bash -euxo pipefail {0}
370    timeout-minutes: 60
371  check_dependencies:
372    needs:
373    - orchestrate
374    if: needs.orchestrate.outputs.run_tests == 'true'
375    runs-on: namespace-profile-2x4-ubuntu-2404
376    steps:
377    - name: steps::checkout_repo
378      uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
379      with:
380        clean: false
381    - name: steps::cache_rust_dependencies_namespace
382      uses: namespacelabs/nscloud-cache-action@v1
383      with:
384        cache: rust
385        path: ~/.rustup
386    - name: run_tests::check_dependencies::install_cargo_machete
387      uses: clechasseur/rs-cargo@8435b10f6e71c2e3d4d3b7573003a8ce4bfc6386
388      with:
389        command: install
390        args: cargo-machete@0.7.0
391    - name: run_tests::check_dependencies::run_cargo_machete
392      uses: clechasseur/rs-cargo@8435b10f6e71c2e3d4d3b7573003a8ce4bfc6386
393      with:
394        command: machete
395    - name: run_tests::check_dependencies::check_cargo_lock
396      run: cargo update --locked --workspace
397      shell: bash -euxo pipefail {0}
398    - name: run_tests::check_dependencies::check_vulnerable_dependencies
399      if: github.event_name == 'pull_request'
400      uses: actions/dependency-review-action@67d4f4bd7a9b17a0db54d2a7519187c65e339de8
401      with:
402        license-check: false
403    timeout-minutes: 60
404  check_docs:
405    needs:
406    - orchestrate
407    if: needs.orchestrate.outputs.run_docs == 'true'
408    runs-on: namespace-profile-8x16-ubuntu-2204
409    steps:
410    - name: steps::checkout_repo
411      uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
412      with:
413        clean: false
414    - name: steps::setup_cargo_config
415      run: |
416        mkdir -p ./../.cargo
417        cp ./.cargo/ci-config.toml ./../.cargo/config.toml
418      shell: bash -euxo pipefail {0}
419    - name: steps::cache_rust_dependencies_namespace
420      uses: namespacelabs/nscloud-cache-action@v1
421      with:
422        cache: rust
423        path: ~/.rustup
424    - name: run_tests::check_docs::lychee_link_check
425      uses: lycheeverse/lychee-action@82202e5e9c2f4ef1a55a3d02563e1cb6041e5332
426      with:
427        args: --no-progress --exclude '^http' './docs/src/**/*'
428        fail: true
429        jobSummary: false
430    - name: steps::setup_linux
431      run: ./script/linux
432      shell: bash -euxo pipefail {0}
433    - name: steps::install_mold
434      run: ./script/install-mold
435      shell: bash -euxo pipefail {0}
436    - name: steps::download_wasi_sdk
437      run: ./script/download-wasi-sdk
438      shell: bash -euxo pipefail {0}
439    - name: ./script/generate-action-metadata
440      run: ./script/generate-action-metadata
441      shell: bash -euxo pipefail {0}
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      shell: bash -euxo pipefail {0}
451    - name: run_tests::check_docs::lychee_link_check
452      uses: lycheeverse/lychee-action@82202e5e9c2f4ef1a55a3d02563e1cb6041e5332
453      with:
454        args: --no-progress --exclude '^http' 'target/deploy/docs'
455        fail: true
456        jobSummary: false
457    timeout-minutes: 60
458  check_licenses:
459    needs:
460    - orchestrate
461    if: needs.orchestrate.outputs.run_licenses == 'true'
462    runs-on: namespace-profile-2x4-ubuntu-2404
463    steps:
464    - name: steps::checkout_repo
465      uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
466      with:
467        clean: false
468    - name: steps::cache_rust_dependencies_namespace
469      uses: namespacelabs/nscloud-cache-action@v1
470      with:
471        cache: rust
472        path: ~/.rustup
473    - name: ./script/check-licenses
474      run: ./script/check-licenses
475      shell: bash -euxo pipefail {0}
476    - name: ./script/generate-licenses
477      run: ./script/generate-licenses
478      shell: bash -euxo pipefail {0}
479  check_scripts:
480    needs:
481    - orchestrate
482    if: needs.orchestrate.outputs.run_action_checks == 'true'
483    runs-on: namespace-profile-2x4-ubuntu-2404
484    steps:
485    - name: steps::checkout_repo
486      uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
487      with:
488        clean: false
489    - name: run_tests::check_scripts::run_shellcheck
490      run: ./script/shellcheck-scripts error
491      shell: bash -euxo pipefail {0}
492    - id: get_actionlint
493      name: run_tests::check_scripts::download_actionlint
494      run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
495      shell: bash -euxo pipefail {0}
496    - name: run_tests::check_scripts::run_actionlint
497      run: |
498        ${{ steps.get_actionlint.outputs.executable }} -color
499      shell: bash -euxo pipefail {0}
500    - name: run_tests::check_scripts::check_xtask_workflows
501      run: |
502        cargo xtask workflows
503        if ! git diff --exit-code .github; then
504          echo "Error: .github directory has uncommitted changes after running 'cargo xtask workflows'"
505          echo "Please run 'cargo xtask workflows' locally and commit the changes"
506          exit 1
507        fi
508      shell: bash -euxo pipefail {0}
509    timeout-minutes: 60
510  build_nix_linux_x86_64:
511    needs:
512    - orchestrate
513    if: needs.orchestrate.outputs.run_nix == 'true'
514    runs-on: namespace-profile-32x64-ubuntu-2004
515    env:
516      ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
517      ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }}
518      ZED_CLOUD_PROVIDER_ADDITIONAL_MODELS_JSON: ${{ secrets.ZED_CLOUD_PROVIDER_ADDITIONAL_MODELS_JSON }}
519      GIT_LFS_SKIP_SMUDGE: '1'
520    steps:
521    - name: steps::checkout_repo
522      uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
523      with:
524        clean: false
525    - name: nix_build::build_nix::install_nix
526      uses: cachix/install-nix-action@02a151ada4993995686f9ed4f1be7cfbb229e56f
527      with:
528        github_access_token: ${{ secrets.GITHUB_TOKEN }}
529    - name: nix_build::build_nix::cachix_action
530      uses: cachix/cachix-action@0fc020193b5a1fa3ac4575aa3a7d3aa6a35435ad
531      with:
532        name: zed
533        authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
534        cachixArgs: -v
535        pushFilter: -zed-editor-[0-9.]*-nightly
536    - name: nix_build::build_nix::build
537      run: nix build .#debug -L --accept-flake-config
538      shell: bash -euxo pipefail {0}
539    timeout-minutes: 60
540    continue-on-error: true
541  build_nix_mac_aarch64:
542    needs:
543    - orchestrate
544    if: needs.orchestrate.outputs.run_nix == 'true'
545    runs-on: namespace-profile-mac-large
546    env:
547      ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
548      ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }}
549      ZED_CLOUD_PROVIDER_ADDITIONAL_MODELS_JSON: ${{ secrets.ZED_CLOUD_PROVIDER_ADDITIONAL_MODELS_JSON }}
550      GIT_LFS_SKIP_SMUDGE: '1'
551    steps:
552    - name: steps::checkout_repo
553      uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
554      with:
555        clean: false
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::cachix_action
561      uses: cachix/cachix-action@0fc020193b5a1fa3ac4575aa3a7d3aa6a35435ad
562      with:
563        name: zed
564        authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
565        cachixArgs: -v
566        pushFilter: -zed-editor-[0-9.]*-nightly
567    - name: nix_build::build_nix::build
568      run: nix build .#debug -L --accept-flake-config
569      shell: bash -euxo pipefail {0}
570    timeout-minutes: 60
571    continue-on-error: true
572  check_postgres_and_protobuf_migrations:
573    needs:
574    - orchestrate
575    if: needs.orchestrate.outputs.run_tests == 'true'
576    runs-on: namespace-profile-16x32-ubuntu-2204
577    env:
578      GIT_AUTHOR_NAME: Protobuf Action
579      GIT_AUTHOR_EMAIL: ci@zed.dev
580      GIT_COMMITTER_NAME: Protobuf Action
581      GIT_COMMITTER_EMAIL: ci@zed.dev
582    steps:
583    - name: steps::checkout_repo
584      uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
585      with:
586        fetch-depth: 0
587    - name: run_tests::check_postgres_and_protobuf_migrations::remove_untracked_files
588      run: git clean -df
589      shell: bash -euxo pipefail {0}
590    - name: run_tests::check_postgres_and_protobuf_migrations::ensure_fresh_merge
591      run: |
592        if [ -z "$GITHUB_BASE_REF" ];
593        then
594          echo "BUF_BASE_BRANCH=$(git merge-base origin/main HEAD)" >> "$GITHUB_ENV"
595        else
596          git checkout -B temp
597          git merge -q "origin/$GITHUB_BASE_REF" -m "merge main into temp"
598          echo "BUF_BASE_BRANCH=$GITHUB_BASE_REF" >> "$GITHUB_ENV"
599        fi
600      shell: bash -euxo pipefail {0}
601    - name: run_tests::check_postgres_and_protobuf_migrations::bufbuild_setup_action
602      uses: bufbuild/buf-setup-action@v1
603      with:
604        version: v1.29.0
605        github_token: ${{ secrets.GITHUB_TOKEN }}
606    - name: run_tests::check_postgres_and_protobuf_migrations::bufbuild_breaking_action
607      uses: bufbuild/buf-breaking-action@v1
608      with:
609        input: crates/proto/proto/
610        against: https://github.com/${GITHUB_REPOSITORY}.git#branch=${BUF_BASE_BRANCH},subdir=crates/proto/proto/
611    timeout-minutes: 60
612  tests_pass:
613    needs:
614    - orchestrate
615    - check_style
616    - clippy_windows
617    - clippy_linux
618    - clippy_mac
619    - run_tests_windows
620    - run_tests_linux
621    - run_tests_mac
622    - doctests
623    - check_workspace_binaries
624    - check_dependencies
625    - check_docs
626    - check_licenses
627    - check_scripts
628    - build_nix_linux_x86_64
629    - build_nix_mac_aarch64
630    if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions') && always()
631    runs-on: namespace-profile-2x4-ubuntu-2404
632    steps:
633    - name: run_tests::tests_pass
634      run: |
635        set +x
636        EXIT_CODE=0
637
638        check_result() {
639          echo "* $1: $2"
640          if [[ "$2" != "skipped" && "$2" != "success" ]]; then EXIT_CODE=1; fi
641        }
642
643        check_result "orchestrate" "${{ needs.orchestrate.result }}"
644        check_result "check_style" "${{ needs.check_style.result }}"
645        check_result "clippy_windows" "${{ needs.clippy_windows.result }}"
646        check_result "clippy_linux" "${{ needs.clippy_linux.result }}"
647        check_result "clippy_mac" "${{ needs.clippy_mac.result }}"
648        check_result "run_tests_windows" "${{ needs.run_tests_windows.result }}"
649        check_result "run_tests_linux" "${{ needs.run_tests_linux.result }}"
650        check_result "run_tests_mac" "${{ needs.run_tests_mac.result }}"
651        check_result "doctests" "${{ needs.doctests.result }}"
652        check_result "check_workspace_binaries" "${{ needs.check_workspace_binaries.result }}"
653        check_result "check_dependencies" "${{ needs.check_dependencies.result }}"
654        check_result "check_docs" "${{ needs.check_docs.result }}"
655        check_result "check_licenses" "${{ needs.check_licenses.result }}"
656        check_result "check_scripts" "${{ needs.check_scripts.result }}"
657        check_result "build_nix_linux_x86_64" "${{ needs.build_nix_linux_x86_64.result }}"
658        check_result "build_nix_mac_aarch64" "${{ needs.build_nix_mac_aarch64.result }}"
659
660        exit $EXIT_CODE
661      shell: bash -euxo pipefail {0}
662concurrency:
663  group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.ref_name == 'main' && github.sha || 'anysha' }}
664  cancel-in-progress: true