-
Notifications
You must be signed in to change notification settings - Fork 32
150 lines (140 loc) · 4.41 KB
/
Copy pathci.yml
File metadata and controls
150 lines (140 loc) · 4.41 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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
name: Continuous integration
on:
push:
branches: [master]
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
check-all-targets:
name: Check all targets
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- run: cargo check --all-targets
- run: cargo check --all-targets --features stats
- run: cargo check --all-targets --no-default-features
- run: cargo check --all-targets --no-default-features --features sharded-lock
- run: cargo check --all-targets --features shuttle
msrv:
name: MSRV
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: taiki-e/install-action@v2
with:
tool: cargo-msrv
# `cargo msrv verify` checks that the crate compiles with the
# `rust-version` declared in Cargo.toml. The default `cargo check` skips
# dev-dependencies, which may require a newer Rust than downstream needs.
- run: cargo msrv verify
- run: cargo msrv verify -- cargo check --features stats
- run: cargo msrv verify -- cargo check --no-default-features
- run: cargo msrv verify -- cargo check --no-default-features --features sharded-lock
test:
name: Tests
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- run: cargo test
- run: cargo test --no-default-features
- run: cargo test --no-default-features --features sharded-lock
# no run because of shuttle feature and non-shuttle tests
- run: cargo test --features shuttle --no-run
shuttle-tests:
name: Shuttle Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- run: cargo test --profile shuttle --features shuttle shuttle
docs:
name: Build Docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
# toolchain: nightly # Temporarily disabled due to doc_auto_cfg removal in nightly
- run: cargo doc --features stats --package quick_cache
# env: # Temporarily disabled due to doc_auto_cfg removal in nightly
# RUSTDOCFLAGS: --cfg docsrs
fuzz-tests:
name: Fuzz tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- run: cargo install cargo-fuzz
- run: for fuzz_test in `cargo fuzz list`; do cargo fuzz run $fuzz_test -- -max_total_time=30 -timeout=5 || exit 1; done
lint:
name: Rustfmt & Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- run: rustup component add rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- run: rustup component add clippy
- uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings
- name: Install dependencies for tools
run: sudo apt-get update && sudo apt-get -y install libfontconfig1-dev jq
- name: Check tools
working-directory: tools
run: cargo clippy -- -D warnings
miri:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
components: miri
- name: Run Miri
run: cargo miri test