Skip to content

Commit

Permalink
feat: bm25 (#2)
Browse files Browse the repository at this point in the history
Signed-off-by: usamoi <[email protected]>
  • Loading branch information
usamoi authored May 31, 2024
1 parent 301c471 commit ad6b490
Show file tree
Hide file tree
Showing 12 changed files with 1,030 additions and 35 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Rust

on:
push:
branches: ["main"]
paths:
- ".cargo/**"
- ".github/**"
- "src/**"
- "Cargo.lock"
- "Cargo.toml"
- "pg_bestmatch.control"
pull_request:
branches: ["main"]
paths:
- ".cargo/**"
- ".github/**"
- "src/**"
- "Cargo.lock"
- "Cargo.toml"
- "pg_bestmatch.control"
merge_group:
workflow_dispatch:

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true

env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
SCCACHE_GHA_ENABLED: true
RUSTC_WRAPPER: sccache
RUSTFLAGS: "-Dwarnings"

jobs:
check:
strategy:
matrix:
version: [12, 13, 14, 15, 16]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Environment
run: |
sudo apt-get remove -y '^postgres.*' '^libpq.*' '^clang.*' '^llvm.*' '^libclang.*' '^libllvm.*' '^mono-llvm.*'
sudo apt-get purge -y '^postgres.*' '^libpq.*' '^clang.*' '^llvm.*' '^libclang.*' '^libllvm.*' '^mono-llvm.*'
sudo apt-get update
sudo apt-get install -y build-essential
- name: Set up Sccache
uses: mozilla-actions/[email protected]
- name: Set up PostgreSQL
run: |
sudo apt-get install -y postgresql-common
echo | sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh
sudo apt update
sudo apt-get install -y postgresql-${{ matrix.version }} postgresql-server-dev-${{ matrix.version }}
- name: Set up Pgrx
run: |
cargo install cargo-pgrx --debug --branch v0.12.0-alpha.1-patch2 --git https://github.com/tensorchord/pgrx.git
cargo pgrx init --pg${{ matrix.version }}=$(which pg_config)
- name: Clippy
run: cargo clippy --lib --features "pg${{ matrix.version }}"
- name: Build
run: cargo build --lib --features "pg${{ matrix.version }}"
7 changes: 7 additions & 0 deletions .taplo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
formatting.indent_string = " "

[[rule]]
include = ["**/Cargo.toml"]
keys = ["dependencies", "dev-dependencies", "lints"]
formatting.reorder_arrays = true
formatting.reorder_keys = true
8 changes: 8 additions & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[default]
extend-ignore-re = [
# Latex formula
"\\$.+?\\$",
]

[files]
extend-exclude = ["tokenizer/*.json"]
Loading

0 comments on commit ad6b490

Please sign in to comment.