8
8
- babushka-core/src/**
9
9
- submodules/**
10
10
- utils/cluster_manager.py
11
+ - .github/workflows/python.yml
11
12
pull_request :
12
13
paths :
13
14
- python/**
14
15
- babushka-core/src/**
15
16
- submodules/**
16
17
- utils/cluster_manager.py
18
+ - .github/workflows/python.yml
17
19
18
20
permissions :
19
21
contents : read
20
22
21
23
jobs :
22
- build :
24
+ test-ubuntu-latest :
23
25
runs-on : ubuntu-latest
24
26
timeout-minutes : 15
25
27
strategy :
39
41
with :
40
42
redis-version : ${{ matrix.redis }}
41
43
42
- - name : Install protoc
43
- run : |
44
- sudo apt update
45
- sudo apt install protobuf-compiler
46
-
47
44
- name : Set up Python 3.10
48
45
uses : actions/setup-python@v3
49
46
with :
@@ -73,23 +70,11 @@ jobs:
73
70
run : |
74
71
black --target-version py36 --check --diff .
75
72
76
- - name : Start redis server
77
- working-directory : ./python
78
- run : redis-server &
79
-
80
- - name : Generate protobuf files
81
- working-directory : .
82
- run : |
83
- MYPY_PROTOC_PATH=`which protoc-gen-mypy`
84
- protoc --plugin=protoc-gen-mypy=${MYPY_PROTOC_PATH} -Iprotobuf=./babushka-core/src/protobuf/ --python_out=./python/python/pybushka --mypy_out=./python/python/pybushka ./babushka-core/src/protobuf/*.proto
85
-
86
- - name : Build Pybushka
87
- working-directory : ./python
88
- run : |
89
- python -m venv .env
90
- source .env/bin/activate
91
- pip install -r requirements.txt
92
- maturin develop --release
73
+ - name : Build Python wrapper
74
+ uses : ./.github/workflows/build-python-wrapper
75
+ with :
76
+ os : ' ubuntu'
77
+ release_mode : ' true'
93
78
94
79
- name : Type check with mypy
95
80
working-directory : ./python
101
86
# Install the benchmark requirements
102
87
pip install -r ../benchmarks/python/requirements.txt
103
88
python -m mypy ..
104
-
89
+
105
90
- name : Test with pytest
106
91
working-directory : ./python
107
92
run : |
@@ -120,3 +105,60 @@ jobs:
120
105
with :
121
106
cargo-toml-folder : ./python
122
107
name : lint python-rust
108
+
109
+ build-macos-latest :
110
+ runs-on : macos-latest
111
+ timeout-minutes : 15
112
+ steps :
113
+ - uses : actions/checkout@v4
114
+ with :
115
+ submodules : recursive
116
+ - name : Set up Homebrew
117
+ uses : Homebrew/actions/setup-homebrew@master
118
+
119
+ - name : Build Python wrapper
120
+ uses : ./.github/workflows/build-python-wrapper
121
+ with :
122
+ os : ' macOS'
123
+ - name : Test compatibility with pytest
124
+ working-directory : ./python
125
+ run : |
126
+ source .env/bin/activate
127
+ pytest --asyncio-mode=auto -m smoke_test
128
+
129
+ build-amazonlinux-latest :
130
+ runs-on : ubuntu-latest
131
+ container : amazonlinux:latest
132
+ timeout-minutes : 15
133
+ steps :
134
+ - name : Install git
135
+ run : |
136
+ yum -y remove git
137
+ yum -y remove git-*
138
+ yum -y install https://packages.endpointdev.com/rhel/7/os/x86_64/endpoint-repo.x86_64.rpm
139
+ yum install -y git
140
+ git --version
141
+
142
+ - uses : actions/checkout@v3
143
+
144
+ - name : Checkout submodules
145
+ run : |
146
+ git config --global --add safe.directory "$GITHUB_WORKSPACE"
147
+ git submodule update --init --recursive
148
+
149
+ - name : Build Python wrapper
150
+ uses : ./.github/workflows/build-python-wrapper
151
+ with :
152
+ os : ' amazon-linux'
153
+
154
+ - name : Create a symbolic Link for redis6 binaries
155
+ working-directory : ./python
156
+ run : |
157
+ ln -s /usr/bin/redis6-server /usr/bin/redis-server
158
+ ln -s /usr/bin/redis6-cli /usr/bin/redis-cli
159
+
160
+ - name : Test compatibility with pytest
161
+ working-directory : ./python
162
+ run : |
163
+ source .env/bin/activate
164
+ pytest --asyncio-mode=auto -m smoke_test
0 commit comments