-
Notifications
You must be signed in to change notification settings - Fork 49
85 lines (69 loc) · 1.71 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
name: ci
on:
pull_request:
push:
branches:
- master
jobs:
test:
name: test
runs-on: ubuntu-latest
strategy:
matrix:
rust: [1.60.0, stable]
include:
- rust: 1.60.0
test_no_std: false
- rust: 1.60.0
test_no_std: true
- rust: stable
test_no_std: true
fail-fast: false
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
components: rustfmt
- name: Check without features
run: cargo check --no-default-features
- name: Run tests
run: cargo test
- name: Run tests using no_std
if: matrix.test_no_std == true
run: cargo test --no-default-features --features alloc
bare-metal:
# tests no alloc, no_std, no getrandom
name: bare-metal
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
targets: thumbv6m-none-eabi
- name: Build
run: cd examples/bare-metal; cargo build
fmt:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- run: cargo fmt --all -- --check
clippy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.60.0
components: clippy
- run: cargo clippy -- -D warnings