Skip to content

Move to traits to avoid unnecessary allocs #150

Move to traits to avoid unnecessary allocs

Move to traits to avoid unnecessary allocs #150

Workflow file for this run

on:
push:
branches:
- main
pull_request:
name: CI
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
check:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo check --all-features
test:
name: Test Suite
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Cache cargo build
uses: Swatinem/rust-cache@v2
- name: Check build with --no-default-features
run: cargo build --no-default-features
- name: Check build with default features
run: cargo build
- name: Check build with tfidf feature
run: cargo build --features tfidf
- name: Check build with textrank feature
run: cargo build --features textrank
- name: Test
run: cargo test --all-features --all --benches
codecov:
name: Code Coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Nighty needed for --doctests support. See https://github.com/taiki-e/cargo-llvm-cov/issues/2
- uses: dtolnay/rust-toolchain@nightly
- name: Cache cargo build
uses: Swatinem/rust-cache@v2
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Generate code coverage
run: cargo llvm-cov --all-features --workspace --lcov --doctests --output-path lcov.info
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: lcov.info
fail_ci_if_error: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- run: cargo fmt --all -- --check