Skip to content

Commit ba262bf

Browse files
committed
test: add integration tests and GitHub Actions CI/release workflows
- Contract tests run against both InMemoryStore and FileMemoryStore - FileMemoryStore-specific: persistence, rebuild_index, path traversal - RelevanceConfig and MemoryItem builder tests - ci.yml: fmt check, clippy, test on push/PR to main - release.yml: CI gate → crates.io publish → GitHub Release on v* tags
1 parent 067a3e0 commit ba262bf

4 files changed

Lines changed: 521 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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+
check:
14+
name: Check
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Install stable toolchain
20+
uses: dtolnay/rust-toolchain@stable
21+
with:
22+
components: rustfmt, clippy
23+
24+
- name: Cache cargo registry
25+
uses: actions/cache@v4
26+
with:
27+
path: |
28+
~/.cargo/registry
29+
~/.cargo/git
30+
target
31+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
32+
restore-keys: ${{ runner.os }}-cargo-
33+
34+
- name: cargo fmt --check
35+
run: cargo fmt --all -- --check
36+
37+
- name: cargo clippy
38+
run: cargo clippy --all-targets --all-features -- -D warnings
39+
40+
- name: cargo test
41+
run: cargo test --all-features

.github/workflows/release.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
env:
9+
CARGO_TERM_COLOR: always
10+
11+
jobs:
12+
ci:
13+
name: CI Gate
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Install stable toolchain
19+
uses: dtolnay/rust-toolchain@stable
20+
with:
21+
components: rustfmt, clippy
22+
23+
- name: Cache cargo registry
24+
uses: actions/cache@v4
25+
with:
26+
path: |
27+
~/.cargo/registry
28+
~/.cargo/git
29+
target
30+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
31+
restore-keys: ${{ runner.os }}-cargo-
32+
33+
- name: cargo fmt --check
34+
run: cargo fmt --all -- --check
35+
36+
- name: cargo clippy
37+
run: cargo clippy --all-targets --all-features -- -D warnings
38+
39+
- name: cargo test
40+
run: cargo test --all-features
41+
42+
publish:
43+
name: Publish to crates.io
44+
needs: ci
45+
runs-on: ubuntu-latest
46+
steps:
47+
- uses: actions/checkout@v4
48+
49+
- name: Install stable toolchain
50+
uses: dtolnay/rust-toolchain@stable
51+
52+
- name: Cache cargo registry
53+
uses: actions/cache@v4
54+
with:
55+
path: |
56+
~/.cargo/registry
57+
~/.cargo/git
58+
target
59+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
60+
restore-keys: ${{ runner.os }}-cargo-
61+
62+
- name: cargo publish
63+
run: cargo publish --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
64+
65+
release:
66+
name: GitHub Release
67+
needs: publish
68+
runs-on: ubuntu-latest
69+
permissions:
70+
contents: write
71+
steps:
72+
- uses: actions/checkout@v4
73+
74+
- name: Create GitHub Release
75+
uses: softprops/action-gh-release@v2
76+
with:
77+
generate_release_notes: true

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# a3s-memory
22

3-
Pluggable memory storage for AI agents.
3+
Pluggable memory storage for A3S.
44

55
Provides the `MemoryStore` trait and two default implementations. Agents that need to persist and recall knowledge across sessions depend on this crate directly — nothing else required.
66

0 commit comments

Comments
 (0)