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