-
Notifications
You must be signed in to change notification settings - Fork 9
50 lines (48 loc) · 1.2 KB
/
tests.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
name: tests
on:
push:
branches:
- main
pull_request:
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
rust: [stable]
os: [ubuntu-latest]
steps:
- name: Check out
uses: actions/checkout@v3
- name: Install Rust
uses: dtolnay/rust-toolchain@master
id: toolchain
with:
toolchain: ${{ matrix.rust }}
components: rustfmt, clippy
- run: rustup override set ${{ steps.toolchain.outputs.name }}
- name: Cache
uses: Swatinem/rust-cache@v2
with:
shared-key: build-cache
save-if: false
- name: Cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: Cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-targets --all-features -- -D warnings
- name: Run cargo tests
uses: actions-rs/cargo@v1
with:
command: test
args: --all-features
- name: Run cargo tests with no default features
uses: actions-rs/cargo@v1
with:
command: test
args: --no-default-features