Allow changing the context window size for Ollama (#44506) #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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: | |
| pull_request: | |
| branches: | |
| - '**' | |
| push: | |
| branches: | |
| - main | |
| - v[0-9]+.[0-9]+.x | |
| jobs: | |
| orchestrate: | |
| if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions') | |
| runs-on: namespace-profile-2x4-ubuntu-2404 | |
| steps: | |
| - name: steps::checkout_repo | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | |
| with: | |
| clean: false | |
| fetch-depth: ${{ github.ref == 'refs/heads/main' && 2 || 350 }} | |
| - id: filter | |
| name: filter | |
| run: | | |
| 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) | |
| if [ -n "$pkg" ]; then | |
| FILE_CHANGED_PKGS=$(printf '%s\n%s' "$FILE_CHANGED_PKGS" "$pkg") | |
| else | |
| # Fall back to directory name if no mapping found | |
| FILE_CHANGED_PKGS=$(printf '%s\n%s' "$FILE_CHANGED_PKGS" "$dir") | |
| 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\n%s' "$FILE_CHANGED_PKGS" "settings" "storybook" "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)))' -qvP | |
| 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 }} | |
| check_style: | |
| if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions') | |
| runs-on: namespace-profile-4x8-ubuntu-2204 | |
| steps: | |
| - name: steps::checkout_repo | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | |
| with: | |
| clean: false | |
| - name: steps::cache_rust_dependencies_namespace | |
| uses: namespacelabs/nscloud-cache-action@v1 | |
| with: | |
| cache: rust | |
| path: ~/.rustup | |
| - name: steps::setup_pnpm | |
| uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 | |
| 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 | |
| timeout-minutes: 60 | |
| clippy_windows: | |
| needs: | |
| - orchestrate | |
| if: needs.orchestrate.outputs.run_tests == 'true' | |
| runs-on: self-32vcpu-windows-2022 | |
| steps: | |
| - name: steps::checkout_repo | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | |
| 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 | |
| steps: | |
| - name: steps::checkout_repo | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | |
| 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@v1 | |
| with: | |
| cache: rust | |
| path: ~/.rustup | |
| - name: steps::setup_linux | |
| run: ./script/linux | |
| - name: steps::install_mold | |
| run: ./script/install-mold | |
| - 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' | |
| runs-on: namespace-profile-mac-large | |
| steps: | |
| - name: steps::checkout_repo | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | |
| 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@v1 | |
| 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 | |
| run_tests_windows: | |
| needs: | |
| - orchestrate | |
| if: needs.orchestrate.outputs.run_tests == 'true' | |
| runs-on: self-32vcpu-windows-2022 | |
| steps: | |
| - name: steps::checkout_repo | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | |
| 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@49933ea5288caeca8642d1e84afbd3f7d6820020 | |
| with: | |
| node-version: '20' | |
| - name: steps::clear_target_dir_if_large | |
| run: ./script/clear-target-dir-if-larger-than.ps1 250 | |
| 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${{ 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' | |
| runs-on: namespace-profile-16x32-ubuntu-2204 | |
| steps: | |
| - name: steps::checkout_repo | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | |
| 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@v1 | |
| with: | |
| cache: rust | |
| path: ~/.rustup | |
| - name: steps::setup_linux | |
| run: ./script/linux | |
| - name: steps::install_mold | |
| run: ./script/install-mold | |
| - name: steps::download_wasi_sdk | |
| run: ./script/download-wasi-sdk | |
| - name: steps::setup_node | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 | |
| with: | |
| node-version: '20' | |
| - name: steps::cargo_install_nextest | |
| uses: taiki-e/install-action@nextest | |
| - name: steps::clear_target_dir_if_large | |
| run: ./script/clear-target-dir-if-larger-than 250 | |
| - 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${{ 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 | |
| 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' | |
| runs-on: namespace-profile-mac-large | |
| steps: | |
| - name: steps::checkout_repo | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | |
| 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@v1 | |
| with: | |
| cache: rust | |
| path: ~/.rustup | |
| - name: steps::setup_node | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 | |
| with: | |
| node-version: '20' | |
| - name: steps::cargo_install_nextest | |
| uses: taiki-e/install-action@nextest | |
| - name: steps::clear_target_dir_if_large | |
| run: ./script/clear-target-dir-if-larger-than 300 | |
| - 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${{ 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 | |
| doctests: | |
| needs: | |
| - orchestrate | |
| if: needs.orchestrate.outputs.run_tests == 'true' | |
| runs-on: namespace-profile-16x32-ubuntu-2204 | |
| steps: | |
| - name: steps::checkout_repo | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | |
| with: | |
| clean: false | |
| - name: steps::cache_rust_dependencies_namespace | |
| uses: namespacelabs/nscloud-cache-action@v1 | |
| with: | |
| cache: rust | |
| path: ~/.rustup | |
| - name: steps::setup_linux | |
| run: ./script/linux | |
| - name: steps::install_mold | |
| run: ./script/install-mold | |
| - 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' | |
| runs-on: namespace-profile-8x16-ubuntu-2204 | |
| steps: | |
| - name: steps::checkout_repo | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | |
| 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@v1 | |
| with: | |
| cache: rust | |
| path: ~/.rustup | |
| - name: steps::setup_linux | |
| run: ./script/linux | |
| - name: steps::install_mold | |
| run: ./script/install-mold | |
| - 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 | |
| check_dependencies: | |
| needs: | |
| - orchestrate | |
| if: needs.orchestrate.outputs.run_tests == 'true' | |
| runs-on: namespace-profile-2x4-ubuntu-2404 | |
| steps: | |
| - name: steps::checkout_repo | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | |
| with: | |
| clean: false | |
| - name: steps::cache_rust_dependencies_namespace | |
| uses: namespacelabs/nscloud-cache-action@v1 | |
| with: | |
| cache: rust | |
| path: ~/.rustup | |
| - name: run_tests::check_dependencies::install_cargo_machete | |
| uses: clechasseur/rs-cargo@8435b10f6e71c2e3d4d3b7573003a8ce4bfc6386 | |
| with: | |
| command: install | |
| args: cargo-machete@0.7.0 | |
| - name: run_tests::check_dependencies::run_cargo_machete | |
| uses: clechasseur/rs-cargo@8435b10f6e71c2e3d4d3b7573003a8ce4bfc6386 | |
| with: | |
| command: machete | |
| - name: run_tests::check_dependencies::check_cargo_lock | |
| run: cargo update --locked --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' | |
| runs-on: namespace-profile-8x16-ubuntu-2204 | |
| steps: | |
| - name: steps::checkout_repo | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | |
| 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@v1 | |
| with: | |
| cache: rust | |
| path: ~/.rustup | |
| - name: run_tests::check_docs::lychee_link_check | |
| uses: lycheeverse/lychee-action@82202e5e9c2f4ef1a55a3d02563e1cb6041e5332 | |
| with: | |
| args: --no-progress --exclude '^http' './docs/src/**/*' | |
| fail: true | |
| jobSummary: false | |
| - name: steps::setup_linux | |
| run: ./script/linux | |
| - name: steps::install_mold | |
| run: ./script/install-mold | |
| - name: steps::download_wasi_sdk | |
| run: ./script/download-wasi-sdk | |
| - name: ./script/generate-action-metadata | |
| run: ./script/generate-action-metadata | |
| - name: run_tests::check_docs::install_mdbook | |
| uses: peaceiris/actions-mdbook@ee69d230fe19748b7abf22df32acaa93833fad08 | |
| with: | |
| mdbook-version: 0.4.37 | |
| - name: run_tests::check_docs::build_docs | |
| run: | | |
| mkdir -p target/deploy | |
| mdbook build ./docs --dest-dir=../target/deploy/docs/ | |
| - name: run_tests::check_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' | |
| runs-on: namespace-profile-2x4-ubuntu-2404 | |
| steps: | |
| - name: steps::checkout_repo | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | |
| with: | |
| clean: false | |
| - name: steps::cache_rust_dependencies_namespace | |
| uses: namespacelabs/nscloud-cache-action@v1 | |
| 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-2x4-ubuntu-2404 | |
| steps: | |
| - name: steps::checkout_repo | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | |
| with: | |
| clean: false | |
| - name: run_tests::check_scripts::run_shellcheck | |
| run: ./script/shellcheck-scripts error | |
| - 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: | | |
| ${{ steps.get_actionlint.outputs.executable }} -color | |
| - 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 | |
| timeout-minutes: 60 | |
| check_postgres_and_protobuf_migrations: | |
| needs: | |
| - orchestrate | |
| if: needs.orchestrate.outputs.run_tests == 'true' | |
| runs-on: namespace-profile-16x32-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::checkout_repo | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | |
| with: | |
| fetch-depth: 0 | |
| - name: run_tests::check_postgres_and_protobuf_migrations::remove_untracked_files | |
| run: git clean -df | |
| - 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@v1 | |
| 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@v1 | |
| with: | |
| input: crates/proto/proto/ | |
| against: https://github.com/${GITHUB_REPOSITORY}.git#branch=${BUF_BASE_BRANCH},subdir=crates/proto/proto/ | |
| timeout-minutes: 60 | |
| tests_pass: | |
| needs: | |
| - orchestrate | |
| - check_style | |
| - clippy_windows | |
| - clippy_linux | |
| - clippy_mac | |
| - run_tests_windows | |
| - run_tests_linux | |
| - run_tests_mac | |
| - doctests | |
| - check_workspace_binaries | |
| - check_dependencies | |
| - check_docs | |
| - check_licenses | |
| - check_scripts | |
| 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" "${{ needs.orchestrate.result }}" | |
| check_result "check_style" "${{ needs.check_style.result }}" | |
| check_result "clippy_windows" "${{ needs.clippy_windows.result }}" | |
| check_result "clippy_linux" "${{ needs.clippy_linux.result }}" | |
| check_result "clippy_mac" "${{ needs.clippy_mac.result }}" | |
| check_result "run_tests_windows" "${{ needs.run_tests_windows.result }}" | |
| check_result "run_tests_linux" "${{ needs.run_tests_linux.result }}" | |
| check_result "run_tests_mac" "${{ needs.run_tests_mac.result }}" | |
| check_result "doctests" "${{ needs.doctests.result }}" | |
| check_result "check_workspace_binaries" "${{ needs.check_workspace_binaries.result }}" | |
| check_result "check_dependencies" "${{ needs.check_dependencies.result }}" | |
| check_result "check_docs" "${{ needs.check_docs.result }}" | |
| check_result "check_licenses" "${{ needs.check_licenses.result }}" | |
| check_result "check_scripts" "${{ needs.check_scripts.result }}" | |
| exit $EXIT_CODE | |
| 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} |