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
name: ci
on:
jobs:
test:
name: test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
rust:
steps:
- name: Checkout repository
uses: actions/checkout@v1
- name: Install Rust
uses: hecrj/setup-rust-action@v1
with:
rust-version: ${{ matrix.rust }}
# Clippy.
#
# We run Clippy for stable and beta only, to minimize the possibility of a
# lint requiring something in the MSRV but the opposite thing in stable,
# or vice versa.
#
# For stable, error out on warnings.
- if: matrix.rust == 'stable'
run: |
rustup component add clippy
cargo clippy --all --all-features -- -D warnings # -W clippy::cargo
#- if: matrix.rust == 'beta'
# run: rustup component add clippy
## For beta, turn warnings into GitHub annotations.
#- if: matrix.rust == 'beta'
# uses: mathiasvr/command-output@v2.0.0
# id: clippy_beta
# with:
# run: |
# # We can warn on additional lints. cargo::nursery might make sense.
# # XXX currently this only shows the first line of output. Also see
# # https://github.com/actions/toolkit/issues/193
# # Replacing '\n' with "%0A" might be a workaround.
# cargo clippy --all --all-features -q --message-format short -- \
# -W clippy::cargo # -W clippy::nursery
#- if: ${{ steps.clippy_beta.outputs.stderr }}
# env:
# clippy_warnings: ${{ steps.clippy_beta.outputs.stderr }}
# run: echo "::warning ::$clippy_warnings"
# Because of all the features, we run build and test twice -- once with
# full features and once without any features at all -- to make it more
# likely that everything works.
# Build
- run: cargo build --verbose --all --all-features
- run: cargo build --verbose --all
# Test
- run: cargo test --verbose --all --all-features
- run: cargo test --verbose --all
# Test using minimal dependency versions from Cargo.toml
- if: matrix.rust != 'beta'
run: |
rustup toolchain install nightly
cargo +nightly update -Z minimal-versions
cargo build --verbose --all --all-features
cargo test --verbose --all --all-features
name: Check and test with minimal-versions