-
Notifications
You must be signed in to change notification settings - Fork 47
98 lines (84 loc) · 2.07 KB
/
rust.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
name: Continuous integration
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
jobs:
# Ensure the crate builds
build:
runs-on: ubuntu-latest
strategy:
matrix:
rust: [1.56.0, stable, nightly]
steps:
- uses: actions/checkout@v2
- uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
- name: Tests
run: |
cargo test -v --no-default-features --tests --lib &&
cargo build --verbose --features "$FEATURES" &&
cargo test --verbose --features "$FEATURES" &&
cargo test --verbose --release --features "$FEATURES"
# Use clippy to lint for code smells
clippy:
runs-on: ubuntu-latest
strategy:
matrix:
# Run Clippy only on stable
rust: [stable]
steps:
- uses: actions/checkout@v2
- uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
toolchain: ${{ matrix.rust }}
components: clippy
override: true
- name: Run Clippy
run: |
cargo clippy
# Enforce rustfmt formatting
formatting:
runs-on: ubuntu-latest
strategy:
matrix:
# Run formatting checks only on stable
rust: [stable]
steps:
- uses: actions/checkout@v2
- uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
toolchain: ${{ matrix.rust }}
components: rustfmt
override: true
- name: Run Clippy
run: |
cargo fmt --all --check
# Ensure the benchmarks compile
benchmark_compiles:
runs-on: ubuntu-latest
strategy:
matrix:
# Check builds only on stable
rust: [stable]
steps:
- uses: actions/checkout@v2
- uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
toolchain: ${{ matrix.rust }}
components: clippy
override: true
- name: Run Clippy
run: |
cd benches
cargo bench --bench benches --no-run