Skip to content

feat(search): add path: substring filter #697

feat(search): add path: substring filter

feat(search): add path: substring filter #697

Workflow file for this run

name: Rust CI
on:
push:
branches:
- master
pull_request:
branches:
- master
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
RUST_TOOLCHAIN: nightly-2025-05-09
jobs:
rust:
name: Rust ${{ matrix.name }}
runs-on: macos-14
strategy:
fail-fast: false
matrix:
include:
- name: fmt
command: cargo fmt --all -- --check
- name: clippy
command: cargo clippy --workspace --all-targets -- -D warnings
- name: check
command: cargo check --workspace --all-targets
- name: test
command: cargo test --workspace
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
components: clippy, rustfmt
- name: Cache cargo build artifacts
uses: Swatinem/rust-cache@v2
- name: Run ${{ matrix.name }}
run: ${{ matrix.command }}
bench:
name: search-cache bench (large corpus)
runs-on: macos-14
# Run only on master push, manual trigger, or PRs with "perf:" title
if: |
github.event_name == 'push' ||
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'pull_request' && startsWith(github.event.pull_request.title, 'perf:'))
defaults:
run:
working-directory: search-cache
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
- name: Cache cargo build artifacts
uses: Swatinem/rust-cache@v2
with:
workspaces: search-cache
# Blobless shallow clone: downloads tree objects + commits only,
# so every file path exists on disk but no file content is fetched.
# Result: ~60 MB instead of ~4 GB for a full linux clone.
- name: Clone Linux kernel (blobless)
run: |
git clone \
--depth=1 \
--filter=blob:none \
--no-tags \
https://github.com/torvalds/linux \
linux-corpus
- name: Run benchmarks
env:
BENCH_CORPUS_DIR: ${{ github.workspace }}/search-cache/linux-corpus
run: cargo bench --quiet --bench walk_and_search -- --output-format bencher | tee bench-output.txt
- name: Upload benchmark results
uses: actions/upload-artifact@v4
with:
name: bench-results
path: |
search-cache/bench-output.txt
search-cache/target/criterion/
tauri:
name: Tauri ${{ matrix.name }}
runs-on: macos-14
strategy:
fail-fast: false
matrix:
include:
- name: fmt
command: cargo fmt -- --check
- name: clippy
command: cargo clippy --all-targets -- -D warnings
- name: check
command: cargo check --all-targets
- name: test
command: cargo test
defaults:
run:
working-directory: cardinal/src-tauri
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
components: clippy, rustfmt
- name: Cache cargo build artifacts
uses: Swatinem/rust-cache@v2
with:
workspaces: cardinal/src-tauri
- name: Run ${{ matrix.name }}
run: ${{ matrix.command }}