-
Notifications
You must be signed in to change notification settings - Fork 0
103 lines (84 loc) · 3.07 KB
/
Copy pathtest.yml
File metadata and controls
103 lines (84 loc) · 3.07 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
101
102
103
name: Tests
on:
workflow_dispatch: # Manual trigger only to save CI minutes
jobs:
test:
name: Test on ${{ matrix.os }} with Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest] # macos-latest is now Apple Silicon
python-version: ["3.10"] # Test only Python 3.10 (most common)
steps:
- uses: actions/checkout@v5
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install system dependencies (Ubuntu)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y gcc g++ make cmake
- name: Build RocksDB dependencies (Linux)
if: runner.os == 'Linux'
run: |
export RDBPY_DEP_DIR=/tmp/rdbpy_deps
bash scripts/build-rocksdb-linux.sh
- name: Build RocksDB dependencies (macOS)
if: runner.os == 'macOS'
run: |
export RDBPY_DEP_DIR=/tmp/rdbpy_deps
bash scripts/build-rocksdb-macos.sh
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip uv
uv pip install --system -e ".[test]"
- name: Install rdbpy
run: |
export RDBPY_DEP_DIR=/tmp/rdbpy_deps
export LD_LIBRARY_PATH=/tmp/rdbpy_deps/lib:$LD_LIBRARY_PATH
export DYLD_LIBRARY_PATH=/tmp/rdbpy_deps/lib:$DYLD_LIBRARY_PATH
uv pip install --system -e .
- name: Run tests
run: |
export LD_LIBRARY_PATH=/tmp/rdbpy_deps/lib:$LD_LIBRARY_PATH
export DYLD_LIBRARY_PATH=/tmp/rdbpy_deps/lib:$DYLD_LIBRARY_PATH
pytest tests/unit/rdbpy -v --tb=short
- name: Run quick integration test
run: |
export LD_LIBRARY_PATH=/tmp/rdbpy_deps/lib:$LD_LIBRARY_PATH
export DYLD_LIBRARY_PATH=/tmp/rdbpy_deps/lib:$DYLD_LIBRARY_PATH
python << 'EOF'
import rdbpy
import tempfile
import os
with tempfile.TemporaryDirectory() as tmpdir:
db_path = os.path.join(tmpdir, "test.db")
opts = rdbpy.Options(create_if_missing=True)
db = rdbpy.DB(db_path, opts)
# Test basic operations
db.put(b"test_key", b"test_value")
assert db.get(b"test_key") == b"test_value"
db.delete(b"test_key")
assert db.get(b"test_key") is None
db.close()
print("✓ Integration test passed!")
EOF
# lint:
# name: Lint and Format Check
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v5
# - name: Set up Python
# uses: actions/setup-python@v6
# with:
# python-version: "3.12"
# - name: Install dependencies
# run: |
# pip install ruff
# - name: Run ruff check
# run: ruff check .
# - name: Run ruff format check
# run: ruff format --check .