run_tests.yml

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