forked from jansegre/python-rocksdb
-
Notifications
You must be signed in to change notification settings - Fork 4
170 lines (148 loc) · 4.77 KB
/
test.yml
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
# yamllint disable rule:line-length
name: Build and test
on: # yamllint disable-line rule:truthy
workflow_dispatch:
push:
branches:
- master
- main
- dev
- release*
tags:
- v*
pull_request:
branches:
- master
- main
- dev
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
librocksdb:
name: Build librocksdb-${{ matrix.rocksdb-version }}
runs-on: ubuntu-22.04
env:
LIBROCKSDB_PATH: /opt/rocksdb
strategy:
fail-fast: false
matrix:
rocksdb-version: ['v6.29.5', 'v7.10.2', 'v8.11.4', 'v9.10.0']
steps:
- uses: actions/cache@v4
id: cache-librocksdb
with:
key: librocksdb-${{ matrix.rocksdb-version }}
path: ${{ env.LIBROCKSDB_PATH }}
- name: Install libraries
if: steps.cache-librocksdb.outputs.cache-hit != 'true'
run: sudo apt install -y libbz2-dev zlib1g-dev libzstd-dev libsnappy-dev liblz4-dev g++ make
- uses: actions/checkout@v4
name: Checkout RocksDB repository
if: steps.cache-librocksdb.outputs.cache-hit != 'true'
with:
repository: facebook/rocksdb
path: ./rocksdb
ref: ${{ matrix.rocksdb-version }}
- name: Build RocksDB ${{ matrix.rocksdb-version }}
if: steps.cache-librocksdb.outputs.cache-hit != 'true'
working-directory: ./rocksdb
run: |
make shared_lib -j8 DISABLE_WARNING_AS_ERROR=1
sudo make install-shared PREFIX=${{ env.LIBROCKSDB_PATH }}
sudo make install-headers PREFIX=${{ env.LIBROCKSDB_PATH }}
test-linux:
name: Test on Python ${{ matrix.python-version}} with librocksdb-${{ matrix.rocksdb-version }}
needs: librocksdb
runs-on: ubuntu-latest
env:
LIBROCKSDB_PATH: /opt/rocksdb
strategy:
fail-fast: false
matrix:
python-version: ['3.10', '3.11', '3.12', '3.13']
rocksdb-version: ['v6.29.5', 'v7.10.2', 'v8.11.4', 'v9.10.0']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}
enable-cache: false
- name: Install libraries
run: sudo apt install -y libbz2-dev zlib1g-dev libzstd-dev libsnappy-dev liblz4-dev g++ make
- name: Restore librocksdb-${{ matrix.rocksdb-version }} from cache
uses: actions/cache@v4
id: cache-librocksdb
with:
key: librocksdb-${{ matrix.rocksdb-version }}
path: ${{ env.LIBROCKSDB_PATH }}
fail-on-cache-miss: true
- name: Build python-rocksdb
env:
CPPFLAGS: -I${{ env.LIBROCKSDB_PATH }}/include
LDFLAGS: -L${{ env.LIBROCKSDB_PATH }}/lib
run: |
uv venv
uv pip install --editable .[test]
- name: Run tests
env:
LD_LIBRARY_PATH: ${{ env.LIBROCKSDB_PATH }}/lib
run: |
uvx pytest
test-macos:
name: Test on Python ${{ matrix.python-version}} with librocksdb from homebrew
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.10', '3.11', '3.12', '3.13']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}
enable-cache: false
- name: Install libraries
run: brew install rocksdb snappy
- name: Build python-rocksdb
run: |
uv venv
uv pip install --editable .[test]
- name: Run tests
run: |
uvx pytest
test-debian:
name: Test on Python ${{ matrix.python-version}} with Debian ${{ matrix.debian-dist }} librocksdb
runs-on: ubuntu-latest
container: debian:${{ matrix.debian-dist }}-slim
strategy:
fail-fast: false
matrix:
python-version: ['3.10', '3.11', '3.12', '3.13']
debian-dist: [bullseye, bookworm]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}
enable-cache: false
- name: Install libraries
run: |
apt update
apt install -y build-essential librocksdb-dev libsnappy-dev zlib1g-dev libbz2-dev liblz4-dev libzstd-dev
- name: Build python-rocksdb
run: |
uv venv
uv pip install --editable .[test]
- name: Run tests
run: |
uvx pytest