-
Notifications
You must be signed in to change notification settings - Fork 9
91 lines (74 loc) · 2.14 KB
/
ci-python.yml
File metadata and controls
91 lines (74 loc) · 2.14 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
name: Python CI
on:
workflow_call:
inputs:
use_local_sdk:
description: 'Override databricks-zerobus-ingest-sdk with the local path dep (for integration testing unreleased Rust changes)'
type: boolean
default: false
jobs:
test:
strategy:
fail-fast: false
matrix:
os: [linux-ubuntu-latest, windows-server-latest]
pyVersion: ['3.9', '3.10', '3.11', '3.12']
runs-on:
group: databricks-protected-runner-group
labels: ${{ matrix.os }}
defaults:
run:
working-directory: python
steps:
- uses: actions/checkout@v4
- name: Unshallow
run: git fetch --prune --unshallow
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.pyVersion }}
- name: Copy root LICENSE for maturin
run: cp ../LICENSE LICENSE
- name: Patch Cargo.toml to use local Rust SDK
if: inputs.use_local_sdk
working-directory: python/rust
run: |
printf '\n[patch.crates-io]\ndatabricks-zerobus-ingest-sdk = { path = "../../rust/sdk" }\n' >> Cargo.toml
- name: Run tests
run: make dev test
fmt:
runs-on:
group: databricks-protected-runner-group
labels: linux-ubuntu-latest
defaults:
run:
working-directory: python
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Copy root LICENSE for maturin
run: cp ../LICENSE LICENSE
- name: Format all files
run: make dev fmt
- name: Fail on differences
run: git diff --exit-code
lint:
runs-on:
group: databricks-protected-runner-group
labels: linux-ubuntu-latest
defaults:
run:
working-directory: python
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Copy root LICENSE for maturin
run: cp ../LICENSE LICENSE
- name: Lint code
run: make dev lint