77 branches : [master, develop]
88
99jobs :
10+ # Rust crate: compile, test, lint (parallel with Python jobs)
11+ rust-check :
12+ name : Rust ${{ matrix.os }}
13+ runs-on : ${{ matrix.os }}
14+ strategy :
15+ matrix :
16+ os : [ubuntu-latest, macos-latest, windows-latest]
17+ steps :
18+ - name : Checkout code
19+ uses : actions/checkout@v4
20+
21+ - name : Set up Python
22+ uses : actions/setup-python@v5
23+ with :
24+ python-version : " 3.13"
25+
26+ - name : Install Rust toolchain
27+ uses : dtolnay/rust-toolchain@stable
28+
29+ - name : Cache cargo registry and build
30+ uses : actions/cache@v4
31+ with :
32+ path : |
33+ ~/.cargo/registry
34+ ~/.cargo/git
35+ type-bridge-core/target
36+ key : ${{ runner.os }}-cargo-${{ hashFiles('type-bridge-core/Cargo.lock') }}
37+ restore-keys : |
38+ ${{ runner.os }}-cargo-
39+
40+ - name : cargo check
41+ working-directory : type-bridge-core
42+ run : cargo check --all-targets
43+
44+ - name : cargo test
45+ working-directory : type-bridge-core
46+ run : cargo test --all-targets
47+
48+ - name : cargo clippy
49+ working-directory : type-bridge-core
50+ run : cargo clippy --all-targets -- -D warnings
51+
52+ # Rust code coverage (informational, does not block CI)
53+ rust-coverage :
54+ name : Rust Coverage
55+ runs-on : ubuntu-latest
56+ continue-on-error : true
57+ steps :
58+ - name : Checkout code
59+ uses : actions/checkout@v4
60+
61+ - name : Install Rust nightly
62+ uses : dtolnay/rust-toolchain@nightly
63+ with :
64+ components : llvm-tools-preview
65+
66+ - name : Install cargo-llvm-cov
67+ uses : taiki-e/install-action@cargo-llvm-cov
68+
69+ - name : Cache cargo registry and build
70+ uses : actions/cache@v4
71+ with :
72+ path : |
73+ ~/.cargo/registry
74+ ~/.cargo/git
75+ type-bridge-core/target
76+ key : ${{ runner.os }}-cargo-nightly-${{ hashFiles('type-bridge-core/Cargo.lock') }}
77+ restore-keys : |
78+ ${{ runner.os }}-cargo-nightly-
79+
80+ - name : Generate LCOV report
81+ run : ./scripts/coverage.sh branch --lcov
82+
83+ - name : Upload Rust coverage to Codecov
84+ uses : codecov/codecov-action@v5
85+ with :
86+ token : ${{ secrets.CODECOV_TOKEN }}
87+ files : type-bridge-core/target/llvm-cov/lcov.branch.info
88+ flags : rust
89+ fail_ci_if_error : false
90+
91+ # Build maturin wheels for all platforms (parallel with other jobs)
92+ build-wheels :
93+ name : Build wheel (${{ matrix.target }})
94+ runs-on : ${{ matrix.runner }}
95+ strategy :
96+ matrix :
97+ include :
98+ - target : x86_64-unknown-linux-gnu
99+ runner : ubuntu-latest
100+ artifact : wheels-linux-x86_64
101+ - target : aarch64-unknown-linux-gnu
102+ runner : ubuntu-latest
103+ artifact : wheels-linux-aarch64
104+ - target : x86_64-apple-darwin
105+ runner : macos-latest
106+ artifact : wheels-macos-x86_64
107+ - target : aarch64-apple-darwin
108+ runner : macos-latest
109+ artifact : wheels-macos-aarch64
110+ - target : x86_64-pc-windows-msvc
111+ runner : windows-latest
112+ artifact : wheels-windows-x86_64
113+ steps :
114+ - name : Checkout code
115+ uses : actions/checkout@v4
116+
117+ - name : Set up QEMU (Linux aarch64 cross-compilation)
118+ if : matrix.target == 'aarch64-unknown-linux-gnu'
119+ uses : docker/setup-qemu-action@v3
120+ with :
121+ platforms : arm64
122+
123+ - name : Set up Python
124+ if : runner.os != 'Linux'
125+ uses : actions/setup-python@v5
126+ with :
127+ python-version : " 3.13"
128+
129+ - name : Build wheel
130+ uses : PyO3/maturin-action@v1
131+ with :
132+ target : ${{ matrix.target }}
133+ args : --release --out dist -i python3.13
134+ manylinux : auto
135+ working-directory : type-bridge-core
136+
137+ - name : Upload wheel artifact
138+ uses : actions/upload-artifact@v4
139+ with :
140+ name : ${{ matrix.artifact }}
141+ path : type-bridge-core/dist/*.whl
142+
10143 # Code quality: linting and formatting (parallel)
11144 lint :
12145 name : Python ${{ matrix.check }}
23156 with :
24157 python-version : " 3.13"
25158
159+ - name : Install Rust toolchain
160+ uses : dtolnay/rust-toolchain@stable
161+
26162 - name : Install uv
27163 uses : astral-sh/setup-uv@v5
28164 with :
55191 with :
56192 python-version : " 3.13"
57193
194+ - name : Install Rust toolchain
195+ uses : dtolnay/rust-toolchain@stable
196+
58197 - name : Install uv
59198 uses : astral-sh/setup-uv@v5
60199 with :
85224 with :
86225 python-version : ${{ matrix.python-version }}
87226
227+ - name : Install Rust toolchain
228+ uses : dtolnay/rust-toolchain@stable
229+
88230 - name : Install uv
89231 uses : astral-sh/setup-uv@v5
90232 with :
@@ -96,8 +238,21 @@ jobs:
96238 - name : Install pytest-xdist for parallel execution
97239 run : uv pip install pytest-xdist
98240
99- - name : Run unit tests in parallel
100- run : uv run pytest tests/unit/ -v --tb=short -n auto
241+ - name : Run unit tests with coverage
242+ run : |
243+ uv run pytest tests/unit/ -v --tb=short -n auto \
244+ --cov=type_bridge --cov-branch \
245+ --cov-report=xml:coverage.xml \
246+ --cov-report=term-missing
247+
248+ - name : Upload Python coverage to Codecov
249+ uses : codecov/codecov-action@v5
250+ if : always()
251+ with :
252+ token : ${{ secrets.CODECOV_TOKEN }}
253+ files : coverage.xml
254+ flags : python
255+ fail_ci_if_error : false
101256
102257 # Integration tests (require TypeDB server, parallel by test category)
103258 test-integration :
@@ -123,6 +278,9 @@ jobs:
123278 with :
124279 python-version : " 3.13"
125280
281+ - name : Install Rust toolchain
282+ uses : dtolnay/rust-toolchain@stable
283+
126284 - name : Install uv
127285 uses : astral-sh/setup-uv@v5
128286 with :
0 commit comments