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
name: CI
on:
push:
branches:
pull_request:
workflow_dispatch:
# A new run supersedes the in-flight one for the same PR/branch; runs on
# main are never cancelled.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
jobs:
# The flagship zero-dependency path: fast, no native toolchains needed.
pure:
name: pure-Rust LightGBM path
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
- run: cargo fmt --check
- run: cargo clippy --locked --no-default-features --all-targets -- -D warnings
- run: cargo test --locked --no-default-features
- run: RUSTDOCFLAGS="-D rustdoc::broken_intra_doc_links" cargo doc --locked --no-default-features --no-deps
# Full build with the native onnx/catboost backends. ort downloads a
# prebuilt ONNX Runtime and catboost-rust a prebuilt libcatboostmodel —
# both need network access at build time.
all-features:
name: onnx + catboost backends
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/rust-cache@v2
- run: cargo clippy --locked --all-features --all-targets -- -D warnings
- run: cargo test --locked --all-features
- run: RUSTDOCFLAGS="-D rustdoc::broken_intra_doc_links" cargo doc --locked --all-features --no-deps
# Minimum supported Rust version (pure path only; the native backends
# track their own MSRVs).
msrv:
name: MSRV
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
# The @ref selects the toolchain version, not a version of the action.
- uses: dtolnay/rust-toolchain@1.65
# cargo 1.65 cannot read the committed v4 lock file, and resolving the
# manifest afresh would clone the multi-GB crates.io git index — the
# sparse protocol needs 1.68+ (measured: >30 min). The pure path
# compiles with zero dependencies, so swapping in a dependency-free
# manifest checks exactly the code `--no-default-features` builds,
# with no registry access at all.
- run: |
rm Cargo.lock
printf '%s\n' \
'[package]' \
'name = "bosk"' \
'version = "0.0.0"' \
'edition = "2021"' \
'rust-version = "1.65"' \
'autobenches = false' \
'' \
'[lib]' \
'path = "src/lib.rs"' \
> Cargo.toml
cargo test