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