Skip to content

Commit 7a16a68

Browse files
committed
Add CI/CD and update badges
- Add GitHub Actions CI workflow for automated testing - Test on Ubuntu, Windows, and macOS - Test with stable and beta Rust - Run format and clippy checks - Add CI, downloads badges to README - Fix all crate name references (zeroentropy -> zeroentropy_community) - Fix API field names in examples (page_number -> page_index) - Update GitHub issues link to correct repository
1 parent b1092b8 commit 7a16a68

File tree

2 files changed

+92
-9
lines changed

2 files changed

+92
-9
lines changed

.github/workflows/ci.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
jobs:
13+
test:
14+
name: Test
15+
runs-on: ${{ matrix.os }}
16+
strategy:
17+
matrix:
18+
os: [ubuntu-latest, windows-latest, macos-latest]
19+
rust: [stable, beta]
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- name: Install Rust
24+
uses: dtolnay/rust-toolchain@master
25+
with:
26+
toolchain: ${{ matrix.rust }}
27+
28+
- name: Cache cargo registry
29+
uses: actions/cache@v4
30+
with:
31+
path: ~/.cargo/registry
32+
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
33+
34+
- name: Cache cargo index
35+
uses: actions/cache@v4
36+
with:
37+
path: ~/.cargo/git
38+
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
39+
40+
- name: Cache cargo build
41+
uses: actions/cache@v4
42+
with:
43+
path: target
44+
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
45+
46+
- name: Build
47+
run: cargo build --verbose
48+
49+
- name: Run tests
50+
run: cargo test --verbose
51+
52+
- name: Run doc tests
53+
run: cargo test --doc --verbose
54+
55+
fmt:
56+
name: Format
57+
runs-on: ubuntu-latest
58+
steps:
59+
- uses: actions/checkout@v4
60+
61+
- name: Install Rust
62+
uses: dtolnay/rust-toolchain@stable
63+
with:
64+
components: rustfmt
65+
66+
- name: Check formatting
67+
run: cargo fmt -- --check
68+
69+
clippy:
70+
name: Clippy
71+
runs-on: ubuntu-latest
72+
steps:
73+
- uses: actions/checkout@v4
74+
75+
- name: Install Rust
76+
uses: dtolnay/rust-toolchain@stable
77+
with:
78+
components: clippy
79+
80+
- name: Run clippy
81+
run: cargo clippy -- -D warnings

README.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# ZeroEntropy Rust SDK
22

3+
[![CI](https://github.com/davidatoms/zeroentropy-rust/workflows/CI/badge.svg)](https://github.com/davidatoms/zeroentropy-rust/actions)
34
[![Crates.io](https://img.shields.io/crates/v/zeroentropy-community.svg)](https://crates.io/crates/zeroentropy-community)
45
[![Documentation](https://docs.rs/zeroentropy-community/badge.svg)](https://docs.rs/zeroentropy-community)
56
[![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](LICENSE)
7+
[![Downloads](https://img.shields.io/crates/d/zeroentropy-community.svg)](https://crates.io/crates/zeroentropy-community)
68

79
Rust client library for the [ZeroEntropy API](https://zeroentropy.dev) - a powerful semantic search and document retrieval service.
810

@@ -16,14 +18,14 @@ Add this to your `Cargo.toml`:
1618

1719
```toml
1820
[dependencies]
19-
zeroentropy-community = "0.1.0"
21+
zeroentropy-community = "0.1.1"
2022
tokio = { version = "1.0", features = ["full"] }
2123
```
2224

2325
## Quick Start
2426

2527
```rust
26-
use zeroentropy::Client;
28+
use zeroentropy_community::Client;
2729

2830
#[tokio::main]
2931
async fn main() -> Result<(), Box<dyn std::error::Error>> {
@@ -72,7 +74,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
7274
For advanced configuration, use the client builder:
7375

7476
```rust
75-
use zeroentropy::Client;
77+
use zeroentropy_community::Client;
7678
use std::time::Duration;
7779

7880
let client = Client::builder()
@@ -92,7 +94,7 @@ client.collections().add("my_collection").await?;
9294

9395
// List all collections
9496
let collections = client.collections().get_list().await?;
95-
for name in collections.collections {
97+
for name in collections.collection_names {
9698
println!("Collection: {}", name);
9799
}
98100

@@ -117,7 +119,7 @@ client.documents().add_text(
117119

118120
```rust
119121
use std::collections::HashMap;
120-
use zeroentropy::MetadataValue;
122+
use zeroentropy_community::MetadataValue;
121123

122124
let mut metadata = HashMap::new();
123125
metadata.insert(
@@ -229,7 +231,7 @@ let results = client.queries().top_pages(
229231
).await?;
230232

231233
for page in results.results {
232-
println!("Page {} of {}", page.page_number, page.path);
234+
println!("Page {} of {}", page.page_index, page.path);
233235
}
234236
```
235237

@@ -260,7 +262,7 @@ let results = client.queries().top_snippets(
260262
Improve search result quality with reranking:
261263

262264
```rust
263-
use zeroentropy::RerankDocument;
265+
use zeroentropy_community::RerankDocument;
264266

265267
let documents = vec![
266268
RerankDocument {
@@ -290,7 +292,7 @@ for result in results.results {
290292
The SDK provides specific error types for different failure scenarios:
291293

292294
```rust
293-
use zeroentropy::Error;
295+
use zeroentropy_community::Error;
294296

295297
match client.collections().add("my_collection").await {
296298
Ok(_) => println!("Success!"),
@@ -356,7 +358,7 @@ This project is licensed under the Apache 2.0 License - see the [LICENSE](LICENS
356358

357359
- **Documentation**: [docs.zeroentropy.dev](https://docs.zeroentropy.dev)
358360
- **Email**: founders@zeroentropy.dev
359-
- **Issues**: [GitHub Issues](https://github.com/zeroentropy-ai/zeroentropy-rust/issues)
361+
- **Issues**: [GitHub Issues](https://github.com/davidatoms/zeroentropy-rust/issues)
360362

361363
## Related Projects
362364

0 commit comments

Comments
 (0)