-
Notifications
You must be signed in to change notification settings - Fork 15
112 lines (105 loc) · 3.17 KB
/
ci.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
name: tests
on:
push:
branches:
# This helps fill the caches properly, caches are not shared between PRs.
- main
pull_request:
branches:
- main
env:
MSRV: "1.63"
RUST_BACKTRACE: 1
RUSTFLAGS: -Dwarnings
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: dtolnay/rust-toolchain@stable
- uses: swatinem/rust-cache@v2
- name: cargo fmt
run: cargo fmt --all -- --check
- name: cargo clippy
run: cargo clippy --locked --workspace --all-targets --all-features
test:
runs-on: ${{ matrix.target.os }}
strategy:
fail-fast: false
matrix:
target:
- os: "ubuntu-latest"
toolchain: "x86_64-unknown-linux-gnu"
name: "Linux GNU"
- os: "macOS-latest"
toolchain: "x86_64-apple-darwin"
name: "macOS"
- os: "windows-latest"
toolchain: "x86_64-pc-windows-msvc"
name: "Windows MSVC"
- os: "windows-latest"
toolchain: "x86_64-pc-windows-gnu"
name: "Windows GNU"
channel:
- "stable"
- "beta"
- "nightly"
steps:
- uses: actions/checkout@v2
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.channel }}
targets: ${{ matrix.target.toolchain }}
- uses: swatinem/rust-cache@v2
- name: cargo test
run: cargo test --locked --workspace --all-features --bins --tests --examples
test-release:
runs-on: ${{ matrix.target.os }}
strategy:
fail-fast: false
matrix:
target:
- os: "ubuntu-latest"
toolchain: "x86_64-unknown-linux-gnu"
name: "Linux GNU"
- os: "macOS-latest"
toolchain: "x86_64-apple-darwin"
name: "macOS"
- os: "windows-latest"
toolchain: "x86_64-pc-windows-msvc"
name: "Windows MSVC"
- os: "windows-latest"
toolchain: "x86_64-pc-windows-gnu"
name: "Windows GNU"
channel:
- "stable"
- "beta"
- "nightly"
steps:
- uses: actions/checkout@v2
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.channel }}
targets: ${{ matrix.target.toolchain }}
- uses: swatinem/rust-cache@v2
- name: cargo test
run: cargo test --release --locked --workspace --all-features --bins --tests --examples
# Checks correct runtime deps and features are requested by not including dev-dependencies.
check-deps:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: dtolnay/rust-toolchain@stable
- uses: swatinem/rust-cache@v2
- name: cargo check
run: cargo check --workspace --all-features --lib --bins
# minimal-crates:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - uses: dtolnay/rust-toolchain@nightly
# - uses: swatinem/rust-cache@v2
# - name: cargo check
# run: |
# rm -f Cargo.lock
# cargo +nightly check -Z minimal-versions --workspace --all-features --lib --bins