-
Notifications
You must be signed in to change notification settings - Fork 0
100 lines (97 loc) · 2.96 KB
/
Copy pathci.yml
File metadata and controls
100 lines (97 loc) · 2.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: CI
on:
push:
branches: [main, master]
pull_request:
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:17-alpine
env:
POSTGRES_DB: test_db
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U postgres -d test_db"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- uses: Swatinem/rust-cache@v2
- name: Initialize test database
env:
PGPASSWORD: postgres
run: |
psql -h 127.0.0.1 -U postgres -d test_db <<'SQL'
CREATE TABLE workspace_members (
team_id TEXT NOT NULL,
user_id TEXT NOT NULL,
role TEXT NOT NULL,
joined_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
CREATE TABLE knowledge_base (
id TEXT PRIMARY KEY DEFAULT md5(random()::text || clock_timestamp()::text),
team_id TEXT NOT NULL,
file_path TEXT NOT NULL,
content_hash TEXT NOT NULL,
embedding REAL[],
metadata JSONB,
user_id TEXT,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
CREATE TABLE pending_knowledge (
id TEXT PRIMARY KEY DEFAULT md5(random()::text || clock_timestamp()::text),
file_path TEXT NOT NULL,
content_hash TEXT NOT NULL,
submitted_by TEXT NOT NULL,
team_id TEXT NOT NULL,
status TEXT NOT NULL,
reviewed_by TEXT,
reviewed_at TIMESTAMPTZ,
rejection_reason TEXT,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
SQL
- run: cargo fmt --package code-memory -- --check
- run: cargo clippy -- -D warnings
- run: cargo test
env:
TEST_DATABASE_URL: postgresql://postgres:postgres@127.0.0.1:5432/test_db
ultracite:
name: Ultracite
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: 22
- name: Install Node.js dependencies
working-directory: npm
run: npm install --ignore-scripts
- name: Ultracite check
working-directory: npm
run: npm run check
npm-package-smoke:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: actions/setup-node@v4
with:
node-version: '20'
- run: cargo build --release
- run: |
cp target/release/code-memory npm/bin/code-memory-bin
chmod +x npm/bin/code-memory-bin
cd npm
npm pack --dry-run
node bin/code-memory --version