-
Notifications
You must be signed in to change notification settings - Fork 13
262 lines (247 loc) · 7.8 KB
/
ci.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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
name: CI
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
on:
workflow_dispatch:
push:
branches: [staging, trying]
pull_request:
branches: [main]
jobs:
ci_build_wheels:
name: Build wheels on ${{ matrix.os }} for Python ${{matrix.python-version}}.
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest] # TODO: add windows-2019,
python-version: ["39", "310", "311", "312"]
env:
CIBW_SKIP: "cp36-* pp* *-win32"
CIBW_ARCHS_MACOS: x86_64 universal2
CIBW_ARCHS_LINUX: auto aarch64
CIBW_BEFORE_ALL_LINUX: "{package}/tools/cibw_before_all_linux.sh"
CIBW_BUILD_VERBOSITY: 1
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/.cargo/.crates.toml
~/.cargo/.crates2.json
target/
key: ${{ matrix.os }}-cargo-${{matrix.python-version}}-${{ hashFiles('**/Cargo.lock') }}
# Used to host cibuildwheel
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- if: runner.os == 'macOS'
name: Install rust toolchain
uses: dtolnay/rust-toolchain@master
with:
targets: aarch64-apple-darwin, x86_64-apple-darwin
toolchain: stable
- if: runner.os != 'Linux'
name: Setup env when not using docker
run: |
python -m pip install --upgrade wheel setuptools setuptools-rust
- if: runner.os == 'Linux'
name: Set up QEMU
id: qemu
uses: docker/setup-qemu-action@v3
with:
platforms: all
- name: Build wheels for ${{matrix.python-version}} on ${{matrix.os}}
uses: pypa/[email protected]
env:
CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28
CIBW_BUILD: "cp${{matrix.python-version}}-manylinux_x86_64 cp${{matrix.python-version}}-macosx_x86_64 cp${{matrix.python-version}}-macosx_universal2 cp${{matrix.python-version}}-macosx_arm64"
ci_build_cc_wheels:
name: Cross Build wheels for ${{ matrix.platform.name }}
runs-on: ubuntu-latest
env:
CARGO: cross
strategy:
matrix:
platform:
[
{ name: "linux_armv7l", target: "armv7-unknown-linux-gnueabihf" },
{ name: "linux_armv6l", target: "arm-unknown-linux-gnueabihf" },
{
name: "manylinux2014_aarch64",
target: "aarch64-unknown-linux-gnu",
},
]
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/.cargo/.crates.toml
~/.cargo/.crates2.json
target/
key: ${{ matrix.platform.target }}-cargo-${{ matrix.platform.name }}-${{ hashFiles('**/Cargo.lock') }}
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: "3.12"
- name: Install Rust ${{ matrix.platform.target }}
uses: dtolnay/rust-toolchain@master
with:
target: ${{ matrix.platform.target }}
toolchain: stable
- name: Install cross
uses: taiki-e/install-action@v2
with:
tool: cross
- name: Install setuptools and setuptools-rust
run: |
python -m pip install --upgrade wheel setuptools setuptools-rust
- name: Build cross image
run: |
docker build -f cross/Dockerfile.${{ matrix.platform.target }} -t fluvio-cross-python:${{ matrix.platform.target }} cross
- name: Build bdist
run: |
python setup.py bdist_wheel --py-limited-api=cp38 --plat-name ${{ matrix.platform.name }}
env:
CARGO_BUILD_TARGET: ${{ matrix.platform.target }}
check_fmt:
name: check formatting
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
rust: [stable]
python-version: ["3.12"]
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/.cargo/.crates.toml
~/.cargo/.crates2.json
target/
key: ${{ matrix.os }}-cargo-${{matrix.python-version}}-${{ hashFiles('**/Cargo.lock') }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install rust ${{ matrix.rust }}
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
- name: check fmt, flake8 and black
run: make lint
- name: Verify Docs generate
run: |
make docs-build
smoke_test:
name: Smoke test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
rust: [stable]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/.cargo/.crates.toml
~/.cargo/.crates2.json
target/
key: ${{ matrix.os }}-cargo-${{matrix.python-version}}-${{ hashFiles('**/Cargo.lock') }}
- name: Install rust ${{ matrix.rust }}
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
# - uses: AbsaOSS/k3d-action@v2
# name: "Create fluvio k3d Cluster"
# with:
# cluster-name: "fluvio"
# - name: Sleep 20 to ensure k3d cluster is ready
# run: sleep 20
# - name: Install Fluvio Cluster on k3d
# uses: infinyon/fluvio@master
# with:
# cluster-type: k3d
# version: stable
- name: Install local Fluvio Cluster
uses: infinyon/fluvio@master
with:
cluster-type: local
version: stable
- name: Check Fluvio Installation
run: |
fluvio version
fluvio topic list
fluvio topic create foobar
sleep 3
echo foo | fluvio produce foobar
fluvio consume foobar -B -d
- name: Build
run: |
make build-dev
- name: Test
uses: nick-fields/retry@v3
with:
timeout_minutes: 15
max_attempts: 3
command: make integration-tests
env:
FLV_SOCKET_WAIT: 300
macos_simple_tests:
name: MacOS Simple test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest]
rust: [stable]
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Install rust ${{ matrix.rust }}
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Build
run: |
make build-dev
- name: Test macOS failing to connect
run: |
make macos-ci-tests
done:
name: Done
needs:
- macos_simple_tests
- smoke_test
- check_fmt
runs-on: ubuntu-latest
steps:
- name: Done
run: echo "Done!"