-
Notifications
You must be signed in to change notification settings - Fork 34
64 lines (54 loc) · 1.63 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
name: Continuous Integration
on:
push:
branches:
- master
pull_request:
branches:
- master
paths-ignore:
- "README.md"
jobs:
fmt:
name: Source formatting check
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Check formatting
run: cargo fmt --check
build:
name: Lint and test check
strategy:
fail-fast: false
matrix:
rust: ["1.70.0", "stable", "nightly"]
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
components: clippy
- name: Restore cargo cache
uses: Swatinem/rust-cache@v2
- name: Run lints
run: cargo clippy -- -D warnings
- name: Run tests
run: |
cargo test --all-targets --all-features
cargo test --all-targets --no-default-features
- name: Install cargo-hack
uses: taiki-e/install-action@cargo-hack
- name: Run tests with feature powerset
# Note: you might think that we can also pass in `--exclude-all-features` here, but that
# isn't the case because if you pass in a --example, it doesn't run doctests. The below
# expression will run doctests as well.
run: cargo hack test --feature-powerset