-
Notifications
You must be signed in to change notification settings - Fork 43
91 lines (85 loc) · 2.82 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
name: CI
on:
push:
branches: [master]
pull_request:
jobs:
test:
name: test ${{ matrix.flags.name }} (${{ matrix.os }})
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
flags:
- name: no default features
flags: --no-default-features
- name: default features
flags: ""
- name: all features
flags: --all-features
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- name: Install test binaries
shell: bash
run: ./.github/scripts/install_test_binaries.sh
- name: Install nextest
uses: taiki-e/install-action@nextest
- uses: Swatinem/rust-cache@v2
- name: test ${{ matrix.flags.flags }}
shell: bash
run: |
cargo nextest run \
${{ matrix.flags.flags }} \
-E "!(kind(test))" \
--retries 2
feature-checks:
name: feature checks
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: taiki-e/install-action@cargo-hack
- uses: Swatinem/rust-cache@v2
- name: cargo hack
run: cargo hack check --feature-powerset --depth 1 --all-targets
clippy:
name: clippy
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@clippy
- uses: Swatinem/rust-cache@v2
- name: clippy
run: cargo clippy --workspace --all-features --all-targets
env:
RUSTFLAGS: "-D warnings"
docs:
name: docs
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@nightly
with:
components: rust-docs
- uses: Swatinem/rust-cache@v2
- name: doc
run: cargo doc --workspace --all-features --no-deps --document-private-items
env:
RUSTDOCFLAGS: "--cfg docsrs -D warnings"
fmt:
name: fmt
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- name: fmt --check
run: cargo fmt --all --check