forked from purpleprotocol/mimalloc_rust
-
Notifications
You must be signed in to change notification settings - Fork 1
133 lines (97 loc) · 3.65 KB
/
ci.yml
File metadata and controls
133 lines (97 loc) · 3.65 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
name: CI
on:
push:
pull_request:
# Run daily to catch when Rust updates cause problems to happen.
schedule:
- cron: "00 01 * * *"
jobs:
rust:
name: Rust
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
toolchain: ["stable"]
runs-on: ${{ matrix.os }}
env:
CARGO_INCREMENTAL: 0
RUST_BACKTRACE: 1
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
- name: Build (secure)
run: cargo build --features secure
- name: Test (secure)
run: cargo test --features secure
- name: Test libmimalloc-sys crate bindings (secure)
run: cargo run --features libmimalloc-sys-test/secure -p libmimalloc-sys-test
- name: Build (no secure)
run: cargo build
- name: Test (no secure)
run: cargo test
- name: Test libmimalloc-sys crate bindings (no secure)
run: cargo run -p libmimalloc-sys-test
- name: Build (extended)
run: cargo build --features extended
- name: Test (extended)
run: cargo test --features extended
- name: Test libmimalloc-sys crate bindings (extended)
run: cargo run --features libmimalloc-sys-test/extended -p libmimalloc-sys-test
- name: Build (v3, secure)
run: cargo build --features v3,secure
- name: Test (v3, secure)
run: cargo test --features v3,secure
- name: Test libmimalloc-sys crate bindings (v3, secure)
run: cargo run --features libmimalloc-sys-test/v3,libmimalloc-sys-test/secure -p libmimalloc-sys-test
- name: Build (v3, no secure)
run: cargo build --features v3
- name: Test (v3, no secure)
run: cargo test --features v3
- name: Test libmimalloc-sys crate bindings (v3, no secure)
run: cargo run --features libmimalloc-sys-test/v3 -p libmimalloc-sys-test
- name: Build (v3, extended)
run: cargo build --features v3,extended
- name: Test (v3, extended)
run: cargo test --features v3,extended
- name: Test libmimalloc-sys crate bindings (v3, extended)
run: cargo run --features libmimalloc-sys-test/v3,libmimalloc-sys-test/extended -p libmimalloc-sys-test
- name: Test override dylib
if: ${{ !contains(matrix.os, 'windows') }}
run: cargo run -ptest-override-with-dylib --features override
lint:
name: Rustfmt / Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Fmt
run: cargo fmt --all -- --check
- name: Clippy
run: cargo clippy --workspace -- -D warnings
# Detect cases where documentation links would be dead
doc:
name: Check documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: dtolnay/rust-toolchain@nightly
# Note: We need to use nightly rust, and `cargo rustdoc` (yes, not `cargo
# doc`) to actually get it to respect -D warnings... Using nightly also
# gets us the nicer syntax for linking to functions, and is in-line with
# what docs.rs uses.
- name: "Check documentation links in `mimalloc`"
run: cargo rustdoc -- -D warnings
- name: "Check documentation links in `bc-libmimalloc-sys`"
run: cargo rustdoc -p bc-libmimalloc-sys -- -D warnings