Files
zed/.github/workflows/run_tests.yml
T
Piotr Osiewicz ceeaeae5b3 ci: Use a smaller Linux runner for migration checks (#64240)
## Summary

Move `check_postgres_and_protobuf_migrations` from the existing 16-vCPU
/ 32-GiB Linux runner to the existing 8-vCPU / 16-GiB runner. The job
handles Git history and Buf compatibility, lint, and formatting checks;
its commands, triggers, and coverage remain unchanged.

This reduces its concurrent CPU and memory allocation by half. Namespace
observations from September 11–14 covered 224 runs, with a typical job
duration of 37 seconds and maximum observed RAM around 1.5 GiB. The p95
of per-run peak CPU usage was about 7.7 cores, so CI runtime on the
smaller profile should be checked rather than assuming identical
performance.

Updated the Rust workflow generator and regenerated the YAML. No other
jobs are changed.

## Validation

- `cargo xtask workflows`
- `cargo fmt -p xtask -- --check`
- `git diff --check`
- Full diff reviewed: two files, only the runner selection changed.
- Actual migration check on the smaller runner awaits CI.

Release Notes:

- N/A
2026-09-15 14:38:10 +00:00

985 lines
38 KiB
YAML

# Generated from xtask::workflows::run_tests
# Rebuild with `cargo xtask workflows`.
name: run_tests
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: '1'
CARGO_INCREMENTAL: '0'
on:
merge_group: {}
pull_request:
branches:
- '**'
push:
branches:
- main
- v[0-9]+.[0-9]+.x
permissions:
contents: read
jobs:
orchestrate:
if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
runs-on: namespace-profile-2x4-ubuntu-2404
steps:
- name: steps::harden_runner
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411
with:
egress-policy: audit
- name: steps::checkout_repo
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
with:
clean: false
fetch-depth: ${{ github.ref == 'refs/heads/main' && 2 || 350 }}
- id: filter
name: filter
run: |
set -euo pipefail
if [ -z "$GITHUB_BASE_REF" ]; then
echo "Not in a PR context (i.e., push to main/stable/preview)"
COMPARE_REV="$(git rev-parse HEAD~1)"
else
echo "In a PR context comparing to pull_request.base.ref"
git fetch origin "$GITHUB_BASE_REF" --depth=350
COMPARE_REV="$(git merge-base "origin/${GITHUB_BASE_REF}" HEAD)"
fi
CHANGED_FILES="$(git diff --name-only "$COMPARE_REV" "$GITHUB_SHA")"
check_pattern() {
local output_name="$1"
local pattern="$2"
local grep_arg="$3"
echo "$CHANGED_FILES" | grep "$grep_arg" "$pattern" && \
echo "${output_name}=true" >> "$GITHUB_OUTPUT" || \
echo "${output_name}=false" >> "$GITHUB_OUTPUT"
}
# Check for changes that require full rebuild (no filter)
# Direct pushes to main/stable/preview always run full suite
if [ -z "$GITHUB_BASE_REF" ]; then
echo "Not a PR, running full test suite"
echo "changed_packages=" >> "$GITHUB_OUTPUT"
elif echo "$CHANGED_FILES" | grep -qP '^(rust-toolchain\.toml|\.cargo/|\.github/|Cargo\.(toml|lock)$)'; then
echo "Toolchain, cargo config, or root Cargo files changed, will run all tests"
echo "changed_packages=" >> "$GITHUB_OUTPUT"
else
# Extract changed directories from file paths
CHANGED_DIRS=$(echo "$CHANGED_FILES" | \
grep -oP '^(crates|tooling)/\K[^/]+' | \
sort -u || true)
# Build directory-to-package mapping using cargo metadata
DIR_TO_PKG=$(cargo metadata --format-version=1 --no-deps 2>/dev/null | \
jq -r '.packages[] | select(.manifest_path | test("crates/|tooling/")) | "\(.manifest_path | capture("(crates|tooling)/(?<dir>[^/]+)") | .dir)=\(.name)"')
# Map directory names to package names
FILE_CHANGED_PKGS=""
for dir in $CHANGED_DIRS; do
pkg=$(echo "$DIR_TO_PKG" | grep "^${dir}=" | cut -d= -f2 | head -1 || true)
# Only add directories that map to a real root-workspace package.
# Some directories (e.g. tooling/lints) belong to a separate workspace
# and are not root members, so they have no mapping here. Previously we
# fell back to the raw directory name, which fabricated a bogus package
# (e.g. "lints") and produced a nextest filter like rdeps(lints) that
# hard-errors ("operator didn't match any packages"). Skipping such
# directories leaves the package set empty, which falls through to the
# "run all tests" path below.
if [ -n "$pkg" ]; then
FILE_CHANGED_PKGS=$(printf '%s\n%s' "$FILE_CHANGED_PKGS" "$pkg")
fi
done
FILE_CHANGED_PKGS=$(echo "$FILE_CHANGED_PKGS" | grep -v '^$' | sort -u || true)
# If assets/ changed, add crates that depend on those assets
if echo "$CHANGED_FILES" | grep -qP '^assets/'; then
FILE_CHANGED_PKGS=$(printf '%s\n%s\n%s' "$FILE_CHANGED_PKGS" "settings" "assets" | sort -u)
fi
# Combine all changed packages
ALL_CHANGED_PKGS=$(echo "$FILE_CHANGED_PKGS" | grep -v '^$' || true)
if [ -z "$ALL_CHANGED_PKGS" ]; then
echo "No package changes detected, will run all tests"
echo "changed_packages=" >> "$GITHUB_OUTPUT"
else
# Build nextest filterset with rdeps for each package
FILTERSET=$(echo "$ALL_CHANGED_PKGS" | \
sed 's/.*/rdeps(&)/' | \
tr '\n' '|' | \
sed 's/|$//')
echo "Changed packages filterset: $FILTERSET"
echo "changed_packages=$FILTERSET" >> "$GITHUB_OUTPUT"
fi
fi
check_pattern "run_action_checks" '^\.github/(workflows/|actions/|actionlint.yml)|tooling/xtask|script/' -qP
check_pattern "run_docs" '^(docs/|crates/.*\.rs)' -qP
check_pattern "run_licenses" '^(Cargo.lock|script/.*licenses)' -qP
check_pattern "run_tests" '^(docs/|script/update_top_ranking_issues/|\.github/(ISSUE_TEMPLATE|workflows/(?!run_tests))|extensions/)' -qvP
# Detect changed extension directories (excluding extensions/workflows)
CHANGED_EXTENSIONS=$(echo "$CHANGED_FILES" | grep -oP '^extensions/[^/]+(?=/)' | sort -u | grep -v '^extensions/workflows$' || true)
# Filter out deleted extensions
EXISTING_EXTENSIONS=""
for ext in $CHANGED_EXTENSIONS; do
if [ -f "$ext/extension.toml" ]; then
EXISTING_EXTENSIONS=$(printf '%s\n%s' "$EXISTING_EXTENSIONS" "$ext")
fi
done
CHANGED_EXTENSIONS=$(echo "$EXISTING_EXTENSIONS" | sed '/^$/d')
if [ -n "$CHANGED_EXTENSIONS" ]; then
EXTENSIONS_JSON=$(echo "$CHANGED_EXTENSIONS" | jq -R -s -c 'split("\n") | map(select(length > 0))')
else
EXTENSIONS_JSON="[]"
fi
echo "changed_extensions=$EXTENSIONS_JSON" >> "$GITHUB_OUTPUT"
outputs:
changed_packages: ${{ steps.filter.outputs.changed_packages }}
run_action_checks: ${{ steps.filter.outputs.run_action_checks }}
run_docs: ${{ steps.filter.outputs.run_docs }}
run_licenses: ${{ steps.filter.outputs.run_licenses }}
run_tests: ${{ steps.filter.outputs.run_tests }}
changed_extensions: ${{ steps.filter.outputs.changed_extensions }}
check_style:
if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions')
runs-on: namespace-profile-4x8-ubuntu-2204
steps:
- name: steps::harden_runner
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411
with:
egress-policy: audit
- name: steps::checkout_repo
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
with:
clean: false
- name: steps::cache_rust_dependencies_namespace
uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9
with:
cache: rust
path: ~/.rustup
- name: steps::setup_pnpm
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320
with:
version: '9'
- name: steps::prettier
run: ./script/prettier
- name: steps::cargo_fmt
run: cargo fmt --all -- --check
- name: ./script/check-todos
run: ./script/check-todos
- name: ./script/check-keymaps
run: ./script/check-keymaps
- name: run_tests::check_style::check_for_typos
uses: crate-ci/typos@2d0ce569feab1f8752f1dde43cc2f2aa53236e06
with:
config: ./typos.toml
- name: run_tests::fetch_ts_query_ls
run: gh release download v3.15.1 --repo ribru17/ts_query_ls --pattern ts_query_ls-x86_64-unknown-linux-gnu.tar.gz --dir "$GITHUB_WORKSPACE"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: run_tests::run_ts_query_ls
run: |-
tar -xf "$GITHUB_WORKSPACE/ts_query_ls-x86_64-unknown-linux-gnu.tar.gz" -C "$GITHUB_WORKSPACE"
"$GITHUB_WORKSPACE/ts_query_ls" format --check . || {
echo "Found unformatted queries, please format them with ts_query_ls."
echo "For easy use, install the Tree-sitter query extension:"
echo "zed://extension/tree-sitter-query"
false
}
timeout-minutes: 60
clippy_windows:
needs:
- orchestrate
if: needs.orchestrate.outputs.run_tests == 'true' && github.event_name != 'merge_group'
runs-on: self-32vcpu-windows-2022
steps:
- name: steps::checkout_repo
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
with:
clean: false
- name: steps::setup_cargo_config
run: |
New-Item -ItemType Directory -Path "./../.cargo" -Force
Copy-Item -Path "./.cargo/ci-config.toml" -Destination "./../.cargo/config.toml"
shell: pwsh
- name: steps::setup_sccache
run: ./script/setup-sccache.ps1
shell: pwsh
env:
R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID }}
R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
SCCACHE_BUCKET: sccache-zed
- name: steps::clippy
run: ./script/clippy.ps1
shell: pwsh
- name: steps::show_sccache_stats
run: if ($env:RUSTC_WRAPPER) { & $env:RUSTC_WRAPPER --show-stats }; exit 0
shell: pwsh
timeout-minutes: 60
clippy_linux:
needs:
- orchestrate
if: needs.orchestrate.outputs.run_tests == 'true'
runs-on: namespace-profile-16x32-ubuntu-2204
env:
CC: clang
CXX: clang++
steps:
- name: steps::harden_runner
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411
with:
egress-policy: audit
- name: steps::checkout_repo
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
with:
clean: false
- name: steps::setup_cargo_config
run: |
mkdir -p ./../.cargo
cp ./.cargo/ci-config.toml ./../.cargo/config.toml
- name: steps::cache_rust_dependencies_namespace
uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9
with:
cache: rust
path: ~/.rustup
- name: steps::setup_linux
run: ./script/linux
- name: steps::download_wasi_sdk
run: ./script/download-wasi-sdk
- name: steps::setup_sccache
run: ./script/setup-sccache
env:
R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID }}
R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
SCCACHE_BUCKET: sccache-zed
- name: steps::clippy
run: ./script/clippy
- name: steps::show_sccache_stats
run: sccache --show-stats || true
timeout-minutes: 60
clippy_mac:
needs:
- orchestrate
if: needs.orchestrate.outputs.run_tests == 'true' && github.event_name != 'merge_group'
runs-on: namespace-profile-mac-large
steps:
- name: steps::checkout_repo
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
with:
clean: false
- name: steps::setup_cargo_config
run: |
mkdir -p ./../.cargo
cp ./.cargo/ci-config.toml ./../.cargo/config.toml
- name: steps::cache_rust_dependencies_namespace
uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9
with:
cache: rust
path: ~/.rustup
- name: steps::setup_sccache
run: ./script/setup-sccache
env:
R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID }}
R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
SCCACHE_BUCKET: sccache-zed
- name: steps::clippy
run: ./script/clippy
- name: steps::show_sccache_stats
run: sccache --show-stats || true
timeout-minutes: 60
clippy_mac_x86_64:
needs:
- orchestrate
if: needs.orchestrate.outputs.run_tests == 'true' && github.event_name != 'merge_group'
runs-on: namespace-profile-mac-large
steps:
- name: steps::checkout_repo
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
with:
clean: false
- name: steps::setup_cargo_config
run: |
mkdir -p ./../.cargo
cp ./.cargo/ci-config.toml ./../.cargo/config.toml
- name: steps::cache_rust_dependencies_namespace
uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9
with:
cache: rust
path: ~/.rustup
- name: steps::install_rustup_target
run: rustup target add x86_64-apple-darwin
- name: steps::setup_sccache
run: ./script/setup-sccache
env:
R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID }}
R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
SCCACHE_BUCKET: sccache-zed
- name: steps::clippy
run: ./script/clippy --target x86_64-apple-darwin
- name: steps::show_sccache_stats
run: sccache --show-stats || true
timeout-minutes: 60
run_tests_windows:
needs:
- orchestrate
if: needs.orchestrate.outputs.run_tests == 'true' && github.event_name != 'merge_group'
runs-on: self-32vcpu-windows-2022
steps:
- name: steps::checkout_repo
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
with:
clean: false
- name: steps::setup_cargo_config
run: |
New-Item -ItemType Directory -Path "./../.cargo" -Force
Copy-Item -Path "./.cargo/ci-config.toml" -Destination "./../.cargo/config.toml"
shell: pwsh
- name: steps::setup_node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e
with:
node-version: '24'
check-latest: true
package-manager-cache: false
- name: steps::clear_target_dir_if_large
run: ./script/clear-target-dir-if-larger-than.ps1 350 200
shell: pwsh
- name: steps::setup_sccache
run: ./script/setup-sccache.ps1
shell: pwsh
env:
R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID }}
R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
SCCACHE_BUCKET: sccache-zed
- name: steps::cargo_nextest
run: cargo nextest run --workspace --no-fail-fast --no-tests=warn${{ needs.orchestrate.outputs.changed_packages && format(' -E "{0}"', needs.orchestrate.outputs.changed_packages) || '' }}
shell: pwsh
- name: steps::show_sccache_stats
run: if ($env:RUSTC_WRAPPER) { & $env:RUSTC_WRAPPER --show-stats }; exit 0
shell: pwsh
- name: steps::cleanup_cargo_config
if: always()
run: |
Remove-Item -Recurse -Path "./../.cargo" -Force -ErrorAction SilentlyContinue
shell: pwsh
timeout-minutes: 60
run_tests_linux:
needs:
- orchestrate
if: needs.orchestrate.outputs.run_tests == 'true' && github.event_name != 'merge_group'
runs-on: namespace-profile-16x32-ubuntu-2204
env:
CC: clang
CXX: clang++
steps:
- name: steps::harden_runner
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411
with:
egress-policy: audit
- name: steps::checkout_repo
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
with:
clean: false
- name: steps::setup_cargo_config
run: |
mkdir -p ./../.cargo
cp ./.cargo/ci-config.toml ./../.cargo/config.toml
- name: steps::cache_rust_dependencies_namespace
uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9
with:
cache: rust
path: ~/.rustup
- name: steps::setup_linux
run: ./script/linux
- name: steps::setup_node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e
with:
node-version: '24'
check-latest: true
package-manager-cache: false
- name: steps::cargo_install_nextest
uses: taiki-e/install-action@a6b2e2dcd845ddd7f509ce4f3ed3d922b80cc5d9
with:
tool: nextest
- name: steps::clear_target_dir_if_large
run: ./script/clear-target-dir-if-larger-than 350 200
- name: steps::download_wasi_sdk
run: ./script/download-wasi-sdk
- name: steps::setup_sccache
run: ./script/setup-sccache
env:
R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID }}
R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
SCCACHE_BUCKET: sccache-zed
- name: steps::cargo_nextest
run: cargo nextest run --workspace --no-fail-fast --no-tests=warn${{ needs.orchestrate.outputs.changed_packages && format(' -E "{0}"', needs.orchestrate.outputs.changed_packages) || '' }}
- name: steps::show_sccache_stats
run: sccache --show-stats || true
- name: steps::cleanup_cargo_config
if: always()
run: |
rm -rf ./../.cargo
timeout-minutes: 60
services:
postgres:
image: postgres:15@sha256:1b92e7a80c021647bf70f5d3eb66066a998e4f5cf43c07bb9dc9f729782cf88e
env:
POSTGRES_HOST_AUTH_METHOD: trust
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 500ms --health-timeout 5s --health-retries 10
run_tests_mac:
needs:
- orchestrate
if: needs.orchestrate.outputs.run_tests == 'true' && github.event_name != 'merge_group'
runs-on: namespace-profile-mac-large
steps:
- name: steps::checkout_repo
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
with:
clean: false
- name: steps::setup_cargo_config
run: |
mkdir -p ./../.cargo
cp ./.cargo/ci-config.toml ./../.cargo/config.toml
- name: steps::cache_rust_dependencies_namespace
uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9
with:
cache: rust
path: ~/.rustup
- name: steps::setup_node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e
with:
node-version: '24'
check-latest: true
package-manager-cache: false
- name: steps::cargo_install_nextest
uses: taiki-e/install-action@a6b2e2dcd845ddd7f509ce4f3ed3d922b80cc5d9
with:
tool: nextest
- name: steps::clear_target_dir_if_large
run: ./script/clear-target-dir-if-larger-than 350 200
- name: steps::download_wasi_sdk
run: ./script/download-wasi-sdk
- name: steps::setup_sccache
run: ./script/setup-sccache
env:
R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID }}
R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
SCCACHE_BUCKET: sccache-zed
- name: steps::cargo_nextest
run: cargo nextest run --workspace --no-fail-fast --no-tests=warn${{ needs.orchestrate.outputs.changed_packages && format(' -E "{0}"', needs.orchestrate.outputs.changed_packages) || '' }}
- name: steps::show_sccache_stats
run: sccache --show-stats || true
- name: steps::cleanup_cargo_config
if: always()
run: |
rm -rf ./../.cargo
timeout-minutes: 60
miri_scheduler:
needs:
- orchestrate
if: needs.orchestrate.outputs.run_tests == 'true' && github.event_name != 'merge_group'
runs-on: namespace-profile-16x32-ubuntu-2204
steps:
- name: steps::harden_runner
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411
with:
egress-policy: audit
- name: steps::checkout_repo
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
with:
clean: false
- name: steps::setup_cargo_config
run: |
mkdir -p ./../.cargo
cp ./.cargo/ci-config.toml ./../.cargo/config.toml
- name: steps::cache_rust_dependencies_namespace
uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9
with:
cache: rust
path: ~/.rustup
- name: run_tests::miri_scheduler::install_miri
run: rustup toolchain install nightly-2026-09-09 --profile minimal --component miri --component rust-src
- name: run_tests::miri_scheduler::clean_miri
run: cargo +nightly-2026-09-09 miri clean
- name: run_tests::miri_scheduler::run_scheduler_tests_under_miri
run: cargo +nightly-2026-09-09 -q miri test -p scheduler
- name: steps::cleanup_cargo_config
if: always()
run: |
rm -rf ./../.cargo
timeout-minutes: 60
doctests:
needs:
- orchestrate
if: needs.orchestrate.outputs.run_tests == 'true' && github.event_name != 'merge_group'
runs-on: namespace-profile-16x32-ubuntu-2204
env:
CC: clang
CXX: clang++
steps:
- name: steps::harden_runner
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411
with:
egress-policy: audit
- name: steps::checkout_repo
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
with:
clean: false
- name: steps::cache_rust_dependencies_namespace
uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9
with:
cache: rust
path: ~/.rustup
- name: steps::setup_linux
run: ./script/linux
- name: steps::download_wasi_sdk
run: ./script/download-wasi-sdk
- name: steps::setup_cargo_config
run: |
mkdir -p ./../.cargo
cp ./.cargo/ci-config.toml ./../.cargo/config.toml
- name: steps::setup_sccache
run: ./script/setup-sccache
env:
R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID }}
R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
SCCACHE_BUCKET: sccache-zed
- id: run_doctests
name: run_tests::doctests::run_doctests
run: |
cargo test --workspace --doc --no-fail-fast
- name: steps::show_sccache_stats
run: sccache --show-stats || true
- name: steps::cleanup_cargo_config
if: always()
run: |
rm -rf ./../.cargo
timeout-minutes: 60
check_workspace_binaries:
needs:
- orchestrate
if: needs.orchestrate.outputs.run_tests == 'true' && github.event_name != 'merge_group'
runs-on: namespace-profile-8x16-ubuntu-2204
env:
CC: clang
CXX: clang++
steps:
- name: steps::harden_runner
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411
with:
egress-policy: audit
- name: steps::checkout_repo
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
with:
clean: false
- name: steps::setup_cargo_config
run: |
mkdir -p ./../.cargo
cp ./.cargo/ci-config.toml ./../.cargo/config.toml
- name: steps::cache_rust_dependencies_namespace
uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9
with:
cache: rust
path: ~/.rustup
- name: steps::setup_linux
run: ./script/linux
- name: steps::download_wasi_sdk
run: ./script/download-wasi-sdk
- name: steps::setup_sccache
run: ./script/setup-sccache
env:
R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID }}
R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
SCCACHE_BUCKET: sccache-zed
- name: cargo build -p collab
run: cargo build -p collab
- name: cargo build --workspace --bins --examples
run: cargo build --workspace --bins --examples
- name: steps::show_sccache_stats
run: sccache --show-stats || true
- name: steps::cleanup_cargo_config
if: always()
run: |
rm -rf ./../.cargo
timeout-minutes: 60
build_visual_tests_binary:
needs:
- orchestrate
if: needs.orchestrate.outputs.run_tests == 'true' && github.event_name != 'merge_group'
runs-on: namespace-profile-mac-large
steps:
- name: steps::checkout_repo
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
with:
clean: false
- name: steps::setup_cargo_config
run: |
mkdir -p ./../.cargo
cp ./.cargo/ci-config.toml ./../.cargo/config.toml
- name: steps::cache_rust_dependencies_namespace
uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9
with:
cache: rust
path: ~/.rustup
- name: run_tests::build_visual_tests_binary::cargo_build_visual_tests
run: cargo build -p zed --bin zed_visual_test_runner --features visual-tests
- name: steps::cleanup_cargo_config
if: always()
run: |
rm -rf ./../.cargo
check_wasm:
needs:
- orchestrate
if: needs.orchestrate.outputs.run_tests == 'true' && github.event_name != 'merge_group'
runs-on: namespace-profile-8x16-ubuntu-2204
steps:
- name: steps::harden_runner
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411
with:
egress-policy: audit
- name: steps::checkout_repo
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
with:
clean: false
- name: steps::setup_cargo_config
run: |
mkdir -p ./../.cargo
cp ./.cargo/ci-config.toml ./../.cargo/config.toml
- name: steps::cache_rust_dependencies_namespace
uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9
with:
cache: rust
path: ~/.rustup
- name: run_tests::check_wasm::install_nightly_wasm_toolchain
run: rustup toolchain install nightly --component rust-src --target wasm32-unknown-unknown
- name: steps::setup_sccache
run: ./script/setup-sccache
env:
R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID }}
R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
SCCACHE_BUCKET: sccache-zed
- name: run_tests::check_wasm::cargo_check_wasm
run: cargo -Zbuild-std=std,panic_abort check --target wasm32-unknown-unknown -p gpui_platform -p cloud_api_client
env:
CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_RUSTFLAGS: -C target-feature=+atomics,+bulk-memory,+mutable-globals
RUSTC_BOOTSTRAP: '1'
- name: steps::show_sccache_stats
run: sccache --show-stats || true
- name: steps::cleanup_cargo_config
if: always()
run: |
rm -rf ./../.cargo
timeout-minutes: 60
check_dependencies:
needs:
- orchestrate
if: needs.orchestrate.outputs.run_tests == 'true' && github.event_name != 'merge_group'
runs-on: namespace-profile-2x4-ubuntu-2404
env:
CC: clang
CXX: clang++
steps:
- name: steps::harden_runner
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411
with:
egress-policy: audit
- name: steps::checkout_repo
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
with:
clean: false
- name: steps::cache_rust_dependencies_namespace
uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9
with:
cache: rust
path: ~/.rustup
- name: run_tests::check_dependencies::install_cargo_shear
uses: taiki-e/install-action@a6b2e2dcd845ddd7f509ce4f3ed3d922b80cc5d9
with:
tool: cargo-shear@1.13.4
- name: run_tests::check_dependencies::run_cargo_shear
run: cargo shear --locked --deny-warnings
- name: run_tests::check_dependencies::check_cargo_lock
run: cargo update --locked --workspace
- name: run_tests::check_dependencies::check_crate_graph
run: 'cargo test --package xtask -- workspace::'
- name: run_tests::check_dependencies::check_vulnerable_dependencies
if: github.event_name == 'pull_request'
uses: actions/dependency-review-action@67d4f4bd7a9b17a0db54d2a7519187c65e339de8
with:
license-check: false
timeout-minutes: 60
check_docs:
needs:
- orchestrate
if: needs.orchestrate.outputs.run_docs == 'true' && github.event_name != 'merge_group'
runs-on: namespace-profile-16x32-ubuntu-2204
env:
DOCS_AMPLITUDE_API_KEY: ${{ secrets.DOCS_AMPLITUDE_API_KEY }}
DOCS_CONSENT_IO_INSTANCE: ${{ secrets.DOCS_CONSENT_IO_INSTANCE }}
CC: clang
CXX: clang++
steps:
- name: steps::harden_runner
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411
with:
egress-policy: audit
- name: steps::checkout_repo
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
with:
clean: false
- name: steps::setup_cargo_config
run: |
mkdir -p ./../.cargo
cp ./.cargo/ci-config.toml ./../.cargo/config.toml
- name: steps::cache_rust_dependencies_namespace
uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9
with:
cache: rust
path: ~/.rustup
- name: steps::setup_linux
run: ./script/linux
- name: steps::download_wasi_sdk
run: ./script/download-wasi-sdk
- name: ./script/generate-action-metadata
run: ./script/generate-action-metadata
- name: deploy_docs::lychee_link_check
uses: lycheeverse/lychee-action@82202e5e9c2f4ef1a55a3d02563e1cb6041e5332
with:
args: --no-progress --exclude '^http' './docs/src/**/*'
fail: true
jobSummary: false
- name: deploy_docs::install_mdbook
uses: peaceiris/actions-mdbook@ee69d230fe19748b7abf22df32acaa93833fad08
with:
mdbook-version: 0.4.37
- name: deploy_docs::build_docs_book
run: |
mkdir -p target/deploy
mdbook build ./docs --dest-dir=../target/deploy/docs/
env:
DOCS_CHANNEL: stable
MDBOOK_BOOK__SITE_URL: /docs/
- name: deploy_docs::lychee_link_check
uses: lycheeverse/lychee-action@82202e5e9c2f4ef1a55a3d02563e1cb6041e5332
with:
args: --no-progress --exclude '^http' 'target/deploy/docs'
fail: true
jobSummary: false
timeout-minutes: 60
check_licenses:
needs:
- orchestrate
if: needs.orchestrate.outputs.run_licenses == 'true' && github.event_name != 'merge_group'
runs-on: namespace-profile-2x4-ubuntu-2404
steps:
- name: steps::harden_runner
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411
with:
egress-policy: audit
- name: steps::checkout_repo
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
with:
clean: false
- name: steps::cache_rust_dependencies_namespace
uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9
with:
cache: rust
path: ~/.rustup
- name: ./script/check-licenses
run: ./script/check-licenses
- name: ./script/generate-licenses
run: ./script/generate-licenses
check_scripts:
needs:
- orchestrate
if: needs.orchestrate.outputs.run_action_checks == 'true'
runs-on: namespace-profile-8x16-ubuntu-2204
steps:
- name: steps::harden_runner
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411
with:
egress-policy: audit
- name: steps::checkout_repo
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
with:
clean: false
- name: run_tests::check_scripts::run_shellcheck
run: ./script/shellcheck-scripts error
- name: steps::cache_rust_dependencies_namespace
uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9
with:
cache: rust
path: ~/.rustup
- name: run_tests::check_scripts::check_xtask_workflows
run: |
cargo xtask workflows
if ! git diff --exit-code .github; then
echo "Error: .github directory has uncommitted changes after running 'cargo xtask workflows'"
echo "Please run 'cargo xtask workflows' locally and commit the changes"
exit 1
fi
- id: get_actionlint
name: run_tests::check_scripts::download_actionlint
run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
- name: run_tests::check_scripts::run_actionlint
run: '"$ACTIONLINT_BIN" -color'
env:
ACTIONLINT_BIN: ${{ steps.get_actionlint.outputs.executable }}
- name: run_tests::check_scripts::run_zizmor
uses: zizmorcore/zizmor-action@6599ee8b7a49aef6a770f63d261d214911a7ce02
with:
advanced-security: false
min-severity: high
version: latest
timeout-minutes: 60
check_postgres_and_protobuf_migrations:
needs:
- orchestrate
if: needs.orchestrate.outputs.run_tests == 'true'
runs-on: namespace-profile-8x16-ubuntu-2204
env:
GIT_AUTHOR_NAME: Protobuf Action
GIT_AUTHOR_EMAIL: ci@zed.dev
GIT_COMMITTER_NAME: Protobuf Action
GIT_COMMITTER_EMAIL: ci@zed.dev
steps:
- name: steps::harden_runner
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411
with:
egress-policy: audit
- name: steps::checkout_repo
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
with:
clean: false
fetch-depth: 0
- name: run_tests::check_postgres_and_protobuf_migrations::ensure_fresh_merge
run: |
if [ -z "$GITHUB_BASE_REF" ];
then
echo "BUF_BASE_BRANCH=$(git merge-base origin/main HEAD)" >> "$GITHUB_ENV"
else
git checkout -B temp
git merge -q "origin/$GITHUB_BASE_REF" -m "merge main into temp"
echo "BUF_BASE_BRANCH=$GITHUB_BASE_REF" >> "$GITHUB_ENV"
fi
- name: run_tests::check_postgres_and_protobuf_migrations::bufbuild_setup_action
uses: bufbuild/buf-setup-action@a47c93e0b1648d5651a065437926377d060baa99
with:
version: v1.29.0
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: run_tests::check_postgres_and_protobuf_migrations::bufbuild_breaking_action
uses: bufbuild/buf-breaking-action@c57b3d842a5c3f3b454756ef65305a50a587c5ba
with:
input: crates/proto/proto/
against: https://github.com/${GITHUB_REPOSITORY}.git#branch=${BUF_BASE_BRANCH},subdir=crates/proto/proto/
- name: run_tests::check_postgres_and_protobuf_migrations::buf_lint
run: buf lint crates/proto/proto
- name: run_tests::check_postgres_and_protobuf_migrations::check_protobuf_formatting
run: buf format --diff --exit-code crates/proto/proto
timeout-minutes: 60
extension_tests:
needs:
- orchestrate
if: needs.orchestrate.outputs.changed_extensions != '[]'
permissions:
contents: read
strategy:
matrix:
extension: ${{ fromJson(needs.orchestrate.outputs.changed_extensions) }}
fail-fast: false
max-parallel: 1
uses: ./.github/workflows/extension_tests.yml
with:
working-directory: ${{ matrix.extension }}
tests_pass:
needs:
- orchestrate
- check_style
- clippy_windows
- clippy_linux
- clippy_mac
- clippy_mac_x86_64
- run_tests_windows
- run_tests_linux
- run_tests_mac
- miri_scheduler
- doctests
- check_workspace_binaries
- build_visual_tests_binary
- check_wasm
- check_dependencies
- check_docs
- check_licenses
- check_scripts
- extension_tests
if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions') && always()
runs-on: namespace-profile-2x4-ubuntu-2404
steps:
- name: run_tests::tests_pass
run: |
set +x
EXIT_CODE=0
check_result() {
echo "* $1: $2"
if [[ "$2" != "skipped" && "$2" != "success" ]]; then EXIT_CODE=1; fi
}
check_result "orchestrate" "$RESULT_ORCHESTRATE"
check_result "check_style" "$RESULT_CHECK_STYLE"
check_result "clippy_windows" "$RESULT_CLIPPY_WINDOWS"
check_result "clippy_linux" "$RESULT_CLIPPY_LINUX"
check_result "clippy_mac" "$RESULT_CLIPPY_MAC"
check_result "clippy_mac_x86_64" "$RESULT_CLIPPY_MAC_X86_64"
check_result "run_tests_windows" "$RESULT_RUN_TESTS_WINDOWS"
check_result "run_tests_linux" "$RESULT_RUN_TESTS_LINUX"
check_result "run_tests_mac" "$RESULT_RUN_TESTS_MAC"
check_result "miri_scheduler" "$RESULT_MIRI_SCHEDULER"
check_result "doctests" "$RESULT_DOCTESTS"
check_result "check_workspace_binaries" "$RESULT_CHECK_WORKSPACE_BINARIES"
check_result "build_visual_tests_binary" "$RESULT_BUILD_VISUAL_TESTS_BINARY"
check_result "check_wasm" "$RESULT_CHECK_WASM"
check_result "check_dependencies" "$RESULT_CHECK_DEPENDENCIES"
check_result "check_docs" "$RESULT_CHECK_DOCS"
check_result "check_licenses" "$RESULT_CHECK_LICENSES"
check_result "check_scripts" "$RESULT_CHECK_SCRIPTS"
check_result "extension_tests" "$RESULT_EXTENSION_TESTS"
exit $EXIT_CODE
env:
RESULT_ORCHESTRATE: ${{ needs.orchestrate.result }}
RESULT_CHECK_STYLE: ${{ needs.check_style.result }}
RESULT_CLIPPY_WINDOWS: ${{ needs.clippy_windows.result }}
RESULT_CLIPPY_LINUX: ${{ needs.clippy_linux.result }}
RESULT_CLIPPY_MAC: ${{ needs.clippy_mac.result }}
RESULT_CLIPPY_MAC_X86_64: ${{ needs.clippy_mac_x86_64.result }}
RESULT_RUN_TESTS_WINDOWS: ${{ needs.run_tests_windows.result }}
RESULT_RUN_TESTS_LINUX: ${{ needs.run_tests_linux.result }}
RESULT_RUN_TESTS_MAC: ${{ needs.run_tests_mac.result }}
RESULT_MIRI_SCHEDULER: ${{ needs.miri_scheduler.result }}
RESULT_DOCTESTS: ${{ needs.doctests.result }}
RESULT_CHECK_WORKSPACE_BINARIES: ${{ needs.check_workspace_binaries.result }}
RESULT_BUILD_VISUAL_TESTS_BINARY: ${{ needs.build_visual_tests_binary.result }}
RESULT_CHECK_WASM: ${{ needs.check_wasm.result }}
RESULT_CHECK_DEPENDENCIES: ${{ needs.check_dependencies.result }}
RESULT_CHECK_DOCS: ${{ needs.check_docs.result }}
RESULT_CHECK_LICENSES: ${{ needs.check_licenses.result }}
RESULT_CHECK_SCRIPTS: ${{ needs.check_scripts.result }}
RESULT_EXTENSION_TESTS: ${{ needs.extension_tests.result }}
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.ref_name == 'main' && github.sha || 'anysha' }}
cancel-in-progress: true
defaults:
run:
shell: bash -euxo pipefail {0}