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