lotabout.skim/.github/workflows/test.yml
LoricAndre 1a10e405f1
feat: improve matcher & reader performance (#1020)
* chore: migrate bench.py to rust to remove python deps

* feat: replace rayon with a custom thread pool manager

* wip: insert into item_list processed_items directly from matcher

* wip: perf optimizations

* wip: perf optimizations

* wip: reader perf optimizations

* fix: skip --bench injected in bench args

* chore: add ARCHITECTURE.md

* Update src/helper/item_reader.rs

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Update src/matcher.rs

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* feat: use the same pool between reader and matcher

* chore: misc

* fix: tests

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2026-03-31 18:05:20 +02:00

137 lines
3.7 KiB
YAML

name: Build & Test
on:
workflow_dispatch:
workflow_call:
inputs:
plan:
required: false
type: string
# pull_request: # No need to trigger on PR, cargo-dist already does
push:
branches:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
nextest:
runs-on: ${{matrix.os}}
strategy:
matrix:
build: [linux, macos, windows]
include:
- build: linux
os: ubuntu-latest
target: x86_64-unknown-linux-musl
- build: macos
os: macos-latest
target: x86_64-apple-darwin
- build: windows
os: windows-latest
target: x86_64-pc-windows-msvc
steps:
- name: "[linux] Install dependencies"
run: |
sudo apt-get install tmux
tmux -V
locale
if: runner.os == 'Linux'
- name: "[macos] Install dependencies"
run: |
brew install tmux
tmux -V
locale
if: runner.os == 'macOS'
env:
HOMEBREW_NO_AUTO_UPDATE: 1
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1
- run: rustup toolchain install
- uses: taiki-e/install-action@v2
with:
tool: nextest@0.9
- uses: taiki-e/install-action@v2
with:
tool: cargo-llvm-cov@0.8
- name: Cache
uses: Swatinem/rust-cache@v2
- name: Run doctests
run: cargo test --doc
- name: Run tests
# Do not use `--all-targets` to avoid running benches
run: cargo llvm-cov nextest --release --profile ci --bins --lib --examples --tests --codecov --output-path codecov.json
env:
LC_ALL: en_US.UTF-8
TERM: xterm-256color
INSTA_UPDATE: new
- name: Show snapshot diffs on failure
if: failure()
run: |
find tests/snapshots/ -name "*.snap.new" | while read -r new_snap; do
base="${new_snap%.new}"
echo "=== Snapshot diff: $base ==="
echo "new: $new_snap"
cat "$new_snap"
if [ -f "$base" ]; then
echo "old: $base"
cat "$base"
diff "$base" "$new_snap"
fi
done
shell: bash
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: codecov.json
fail_ci_if_error: false
continue-on-error: true
- name: Upload test results to Codecov
uses: codecov/codecov-action@v5
with:
report_type: test_results
token: ${{ secrets.CODECOV_TOKEN }}
files: target/nextest/ci/junit.xml
fail_ci_if_error: false
continue-on-error: true
clippy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 1
- run: rustup toolchain install
- name: Cache
uses: Swatinem/rust-cache@v2
- name: Clippy
run: cargo clippy
rustfmt:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- run: rustup toolchain install
- name: Check formatting
run: |
cargo fmt --all -- --check
build-no-default-features:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- run: rustup toolchain install
- name: Cache
uses: Swatinem/rust-cache@v2
- name: Build without any feature
run: |
cargo build --no-default-features