forked from glitzflitz/pyxorfilter
-
Notifications
You must be signed in to change notification settings - Fork 0
99 lines (80 loc) · 2.49 KB
/
pytests.yml
File metadata and controls
99 lines (80 loc) · 2.49 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
name: Python Tests
on: [push, pull_request]
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.12", "3.13"]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install system dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y python3-dev
- name: Install system dependencies (macOS)
if: runner.os == 'macOS'
run: |
# Xcode command line tools should be available by default
- name: Install system dependencies (Windows)
if: runner.os == 'Windows'
run: |
# Windows typically has MSVC available
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
python -m pip install setuptools wheel cffi xxhash pytest
- name: Build CFFI extension
run: |
python setup.py build_ext
- name: Install package
run: |
python setup.py install
- name: Run tests
run: |
python -m pytest tests/ -v --tb=short
- name: Test import and basic functionality
run: |
python -c "
import pyfusefilter
print('[OK] Import successful')
# Test basic functionality
f = pyfusefilter.Xor8([1, 2, 3, 4, 5])
print(f'[OK] Filter created: {f}')
print(f'[OK] Contains 3: {f.contains(3)}')
print(f'[OK] Does not contain 10: {not f.contains(10)}')
# Test serialization
serialized = f.serialize()
recovered = pyfusefilter.Xor8.deserialize(serialized)
print(f'[OK] Serialization works: {recovered.contains(3)}')
"
build-wheel:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
python -m pip install build setuptools wheel cffi
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y python3-dev
- name: Build wheel
run: |
python -m build --wheel