-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (77 loc) · 2.92 KB
/
Copy pathbazel-python.yml
File metadata and controls
87 lines (77 loc) · 2.92 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
name: bazel · python
# Bazel-native dev / test path for the batchalign Python package.
# The cdylib is built by `rust_shared_library` + macOS dynamic_lookup
# link flags + a static pyo3-config.txt (see crates/batchalign/
# batchalign-engine/BUILD.bazel and bazel/python/pyo3-config.txt).
# `py_library` / `py_binary` / `py_test` consume the natively-built .so
# directly — no maturin in this loop.
#
# The release wheel still uses maturin (sole pyproject.toml reader for
# the multi-platform tagging matrix); that's the publish-pypi workflow.
on:
workflow_dispatch: {}
push:
branches: [main]
paths:
- "python/**"
- "crates/batchalign/batchalign-core/**"
- "crates/batchalign/batchalign-engine/**"
- "bazel/python/**"
- "MODULE.bazel"
- ".bazelignore"
- ".bazelrc"
- "MODULE.bazel.lock"
- ".github/workflows/bazel-python.yml"
pull_request:
paths:
- "python/**"
- "crates/batchalign/batchalign-core/**"
- "crates/batchalign/batchalign-engine/**"
- "bazel/python/**"
- "MODULE.bazel"
- ".bazelignore"
- ".bazelrc"
- "MODULE.bazel.lock"
- ".github/workflows/bazel-python.yml"
concurrency:
group: bazel-python-${{ github.ref }}
cancel-in-progress: true
env:
BAZELISK_SKIP_WRAPPER: true
jobs:
build-and-test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-14]
steps:
- uses: actions/checkout@v4
- uses: bazel-contrib/setup-bazel@0.19.0
with:
bazelisk-cache: true
disk-cache: ${{ github.workflow }}
repository-cache: true
cache-version: 2-${{ runner.os }}-${{ runner.arch }}
# Lockfile drift test exists at //python:requirements_test but is
# tagged `manual` (see python/BUILD.bazel) because uv 0.5.18 with
# `--universal` is host-OS-dependent and the test ping-pongs.
# Contributors regenerate the lockfile with
# `bazel run //python:requirements`. We don't enforce drift in CI
# until the uv pin is bumped to a deterministic release.
# Bazel-native cdylib via rust_shared_library + pyo3-config.txt.
# Verifies the abi3 + dynamic_lookup wiring builds an importable .so.
- name: bazel build engine cdylib + py_library
run: |
bazel build --config=ci \
//crates/batchalign/batchalign-engine:_core_so \
//python/batchalign:batchalign_lib \
//python/batchalign:batchalign \
//python/batchalign:wheel
# py_test runs pytest against the Bazel-built .so.
- name: bazel test pytest
run: bazel test --config=ci //python/batchalign:pytest
# Smoke: invoke the CLI through py_binary to catch packaging regressions
# that pytest alone wouldn't surface (PYTHONPATH, runfiles layout, etc.).
- name: CLI smoke (py_binary --help)
run: bazel run //python/batchalign -- --help