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
name: CI
on:
push:
branches:
pull_request:
branches:
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: "-D warnings"
jobs:
build-test:
name: fmt / clippy / test / doc / examples
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Cache cargo registry and target
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
# plotters' default font backend needs fontconfig + a font present.
- name: Install font dependencies
run: sudo apt-get update && sudo apt-get install -y libfontconfig1-dev fonts-dejavu-core
- name: Format check
run: cargo fmt --all -- --check
- name: Clippy (deny warnings)
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Test
run: cargo test --all-features
- name: Doc build
run: cargo doc --no-deps --all-features
# Cheap regression check: every example must render without panicking.
# (Definition of done for Milestone 0.)
- name: Run examples
run: |
for ex in box_plot violin_plot roc_curve precision_recall_curve regularization_path residual_plot dashboard ecdf qq_plot calibration_curve gain_chart heatmap correlation_heatmap missingness_heatmap pair_plot; do
echo "::group::example $ex"
cargo run --example "$ex"
echo "::endgroup::"
done
msrv:
name: MSRV (1.70)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.70.0
- run: sudo apt-get update && sudo apt-get install -y libfontconfig1-dev fonts-dejavu-core
- name: Build on MSRV
run: cargo build --all-targets