-
Notifications
You must be signed in to change notification settings - Fork 14
143 lines (138 loc) · 3.79 KB
/
main.yml
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
134
135
136
137
138
139
140
141
142
143
name: Run tests, check code
on: [push, pull_request]
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
RUST_LOG: info
jobs:
tests:
strategy:
matrix:
include:
- os: macos-latest
- os: windows-latest
toolchain-suffix: -gnu
- os: windows-latest
toolchain-suffix: -msvc
- os: ubuntu-latest
runs-on: ${{ matrix.os }}
steps:
- name: Clone Git repository
uses: actions/checkout@v3
with:
submodules: true
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable${{ matrix.toolchain-suffix }}
- name: Run tests (all features)
run: |
cargo test --workspace --all-features
- name: Run tests (no features)
run: |
cargo test --workspace --no-default-features
- name: Test benchmarks
run: |
cargo test --benches
msrv:
strategy:
matrix:
rust-version: ["1.38"]
runs-on: ubuntu-latest
steps:
- name: Clone Git repository
uses: actions/checkout@v3
with:
submodules: true
- name: Install Rust version ${{ matrix.rust-version }}
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust-version }}
- name: Check whether it compiles
run: |
cargo check --all-features --verbose
check-code:
runs-on: ubuntu-latest
steps:
- name: Clone Git repository
uses: actions/checkout@v3
with:
submodules: true
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: rustfmt, clippy
- name: rustfmt
run: |
cargo fmt --all --check
- name: clippy
run: |
cargo clippy --all-targets --all-features -- -D warnings
- name: Build docs
run: |
cargo rustdoc --all-features -- -D warnings
- name: Upload docs
uses: actions/upload-artifact@v3
with:
name: docs
path: target/doc/*
- name: packaging
run: |
cargo package --verbose
no_std:
runs-on: ubuntu-latest
steps:
- name: Clone Git repository
uses: actions/checkout@v3
with:
submodules: true
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- name: Install cargo-nono
# --locked is recommended, see https://github.com/hobofan/cargo-nono/pull/68
run: |
cargo install cargo-nono --locked
- name: Check no_std compatibility
run: |
cargo nono check
miri:
runs-on: ubuntu-latest
steps:
- name: Clone Git repository
uses: actions/checkout@v3
with:
submodules: true
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
components: miri
- name: Run Miri
run: |
cargo miri test
- name: Run Miri again (with miri-preemption-rate=0)
env:
MIRIFLAGS: "-Zmiri-preemption-rate=0"
# For now, this is only run on one test, see https://github.com/mgeier/rtrb/issues/114
run: |
cargo miri test no_race_with_is_abandoned
thread-sanitizer:
runs-on: ubuntu-latest
steps:
- name: Clone Git repository
uses: actions/checkout@v3
with:
submodules: true
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
components: rust-src
- name: Run ThreadSanitizer
env:
RUSTFLAGS: "-Z sanitizer=thread"
run: |
cargo test --tests -Z build-std --target x86_64-unknown-linux-gnu