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: if ($env:RUSTC_WRAPPER) { & $env:RUSTC_WRAPPER --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_node
256 uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
257 with:
258 node-version: '20'
259 - name: steps::clear_target_dir_if_large
260 run: ./script/clear-target-dir-if-larger-than.ps1 250
261 shell: pwsh
262 - name: steps::setup_sccache
263 run: ./script/setup-sccache.ps1
264 shell: pwsh
265 env:
266 R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID }}
267 R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
268 R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
269 SCCACHE_BUCKET: sccache-zed
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: if ($env:RUSTC_WRAPPER) { & $env:RUSTC_WRAPPER --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_node
308 uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
309 with:
310 node-version: '20'
311 - name: steps::cargo_install_nextest
312 uses: taiki-e/install-action@nextest
313 - name: steps::clear_target_dir_if_large
314 run: ./script/clear-target-dir-if-larger-than 250
315 - name: steps::setup_sccache
316 run: ./script/setup-sccache
317 env:
318 R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID }}
319 R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
320 R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
321 SCCACHE_BUCKET: sccache-zed
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_node
359 uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
360 with:
361 node-version: '20'
362 - name: steps::cargo_install_nextest
363 uses: taiki-e/install-action@nextest
364 - name: steps::clear_target_dir_if_large
365 run: ./script/clear-target-dir-if-larger-than 300
366 - name: steps::setup_sccache
367 run: ./script/setup-sccache
368 env:
369 R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID }}
370 R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
371 R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
372 SCCACHE_BUCKET: sccache-zed
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 clean: false
609 fetch-depth: 0
610 - name: run_tests::check_postgres_and_protobuf_migrations::ensure_fresh_merge
611 run: |
612 if [ -z "$GITHUB_BASE_REF" ];
613 then
614 echo "BUF_BASE_BRANCH=$(git merge-base origin/main HEAD)" >> "$GITHUB_ENV"
615 else
616 git checkout -B temp
617 git merge -q "origin/$GITHUB_BASE_REF" -m "merge main into temp"
618 echo "BUF_BASE_BRANCH=$GITHUB_BASE_REF" >> "$GITHUB_ENV"
619 fi
620 - name: run_tests::check_postgres_and_protobuf_migrations::bufbuild_setup_action
621 uses: bufbuild/buf-setup-action@v1
622 with:
623 version: v1.29.0
624 github_token: ${{ secrets.GITHUB_TOKEN }}
625 - name: run_tests::check_postgres_and_protobuf_migrations::bufbuild_breaking_action
626 uses: bufbuild/buf-breaking-action@v1
627 with:
628 input: crates/proto/proto/
629 against: https://github.com/${GITHUB_REPOSITORY}.git#branch=${BUF_BASE_BRANCH},subdir=crates/proto/proto/
630 timeout-minutes: 60
631 tests_pass:
632 needs:
633 - orchestrate
634 - check_style
635 - clippy_windows
636 - clippy_linux
637 - clippy_mac
638 - run_tests_windows
639 - run_tests_linux
640 - run_tests_mac
641 - doctests
642 - check_workspace_binaries
643 - check_dependencies
644 - check_docs
645 - check_licenses
646 - check_scripts
647 if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions') && always()
648 runs-on: namespace-profile-2x4-ubuntu-2404
649 steps:
650 - name: run_tests::tests_pass
651 run: |
652 set +x
653 EXIT_CODE=0
654
655 check_result() {
656 echo "* $1: $2"
657 if [[ "$2" != "skipped" && "$2" != "success" ]]; then EXIT_CODE=1; fi
658 }
659
660 check_result "orchestrate" "${{ needs.orchestrate.result }}"
661 check_result "check_style" "${{ needs.check_style.result }}"
662 check_result "clippy_windows" "${{ needs.clippy_windows.result }}"
663 check_result "clippy_linux" "${{ needs.clippy_linux.result }}"
664 check_result "clippy_mac" "${{ needs.clippy_mac.result }}"
665 check_result "run_tests_windows" "${{ needs.run_tests_windows.result }}"
666 check_result "run_tests_linux" "${{ needs.run_tests_linux.result }}"
667 check_result "run_tests_mac" "${{ needs.run_tests_mac.result }}"
668 check_result "doctests" "${{ needs.doctests.result }}"
669 check_result "check_workspace_binaries" "${{ needs.check_workspace_binaries.result }}"
670 check_result "check_dependencies" "${{ needs.check_dependencies.result }}"
671 check_result "check_docs" "${{ needs.check_docs.result }}"
672 check_result "check_licenses" "${{ needs.check_licenses.result }}"
673 check_result "check_scripts" "${{ needs.check_scripts.result }}"
674
675 exit $EXIT_CODE
676concurrency:
677 group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.ref_name == 'main' && github.sha || 'anysha' }}
678 cancel-in-progress: true
679defaults:
680 run:
681 shell: bash -euxo pipefail {0}