|
1 |
| -on: [push, pull_request] |
2 |
| - |
3 | 1 | name: build
|
4 | 2 |
|
| 3 | +on: [push, pull_request] |
| 4 | + |
5 | 5 | jobs:
|
6 | 6 | build:
|
7 |
| - name: Lints and Test |
| 7 | + name: Build |
8 | 8 | strategy:
|
| 9 | + fail-fast: false |
9 | 10 | matrix:
|
10 | 11 | platform: [ubuntu-latest, macos-latest, windows-latest]
|
11 | 12 | toolchain: [stable]
|
12 | 13 | runs-on: ${{ matrix.platform }}
|
13 | 14 |
|
14 | 15 | steps:
|
15 |
| - - name: Checkout sources |
| 16 | + - name: Checkout Sources |
16 | 17 | uses: actions/checkout@v2
|
17 | 18 |
|
18 |
| - - name: Install Rust toolchain |
| 19 | + - name: Cache Dependencies & Build Outputs |
| 20 | + uses: actions/cache@v2 |
| 21 | + with: |
| 22 | + path: ~/.cargo |
| 23 | + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} |
| 24 | + |
| 25 | + - name: Install Rust Toolchain |
19 | 26 | uses: actions-rs/toolchain@v1
|
20 | 27 | with:
|
21 | 28 | profile: minimal
|
22 | 29 | toolchain: ${{ matrix.toolchain }}
|
23 | 30 | override: true
|
24 | 31 | components: rustfmt, clippy
|
25 | 32 |
|
26 |
| - - name: Run cargo fmt |
| 33 | + - name: Check Code Format |
27 | 34 | uses: actions-rs/cargo@v1
|
28 | 35 | with:
|
29 | 36 | command: fmt
|
30 | 37 | args: --all -- --check
|
31 | 38 |
|
32 |
| - - name: Run cargo clippy |
| 39 | + - name: Code Lint |
33 | 40 | uses: actions-rs/cargo@v1
|
34 | 41 | with:
|
35 | 42 | command: clippy
|
36 | 43 | args: --all-targets --all-features --workspace -- -D warnings
|
37 | 44 |
|
38 |
| - - name: Run cargo test |
| 45 | + - name: Code Lint Without Default Features |
| 46 | + uses: actions-rs/cargo@v1 |
| 47 | + with: |
| 48 | + command: clippy |
| 49 | + args: --no-default-features --workspace -- -D warnings |
| 50 | + |
| 51 | + - name: Test |
39 | 52 | uses: actions-rs/cargo@v1
|
40 | 53 | with:
|
41 | 54 | command: test
|
42 | 55 | args: --all-features --workspace
|
43 | 56 |
|
44 |
| - coverage: |
45 |
| - name: Code Coverage |
| 57 | + ensure_no_std: |
| 58 | + name: Ensure no_std |
46 | 59 | runs-on: ubuntu-latest
|
47 | 60 | steps:
|
48 |
| - - name: Checkout sources |
| 61 | + - name: Checkout Sources |
49 | 62 | uses: actions/checkout@v2
|
50 | 63 |
|
51 |
| - - name: Install stable Rust toolchain |
| 64 | + - name: Install Rust Toolchain |
52 | 65 | uses: actions-rs/toolchain@v1
|
53 | 66 | with:
|
54 | 67 | profile: minimal
|
55 | 68 | toolchain: stable
|
56 | 69 | override: true
|
| 70 | + target: thumbv6m-none-eabi |
57 | 71 |
|
58 |
| - - name: Run cargo-tarpaulin |
59 |
| - uses: actions-rs/tarpaulin@v0.1 |
| 72 | + - name: Build |
| 73 | + uses: actions-rs/cargo@v1 |
60 | 74 | with:
|
61 |
| - args: '--all-features -- --test-threads 1' |
| 75 | + command: build |
| 76 | + args: --no-default-features --workspace --target thumbv6m-none-eabi |
62 | 77 |
|
63 |
| - - name: Upload to codecov.io |
64 |
| - uses: codecov/codecov-action@v1.0.6 |
65 |
| - |
66 |
| - no-default-features: |
67 |
| - name: Clippy with no default features (for no_std envs) |
| 78 | + coverage: |
| 79 | + name: Code Coverage |
68 | 80 | runs-on: ubuntu-latest
|
69 | 81 | steps:
|
70 |
| - - name: Checkout sources |
| 82 | + - name: Checkout Sources |
71 | 83 | uses: actions/checkout@v2
|
72 | 84 |
|
73 |
| - - name: Install Rust toolchain |
| 85 | + - name: Install Rust Toolchain |
74 | 86 | uses: actions-rs/toolchain@v1
|
75 | 87 | with:
|
76 | 88 | profile: minimal
|
77 | 89 | toolchain: stable
|
78 | 90 | override: true
|
79 |
| - components: clippy |
80 | 91 |
|
81 |
| - - name: Run cargo clippy |
82 |
| - uses: actions-rs/cargo@v1 |
| 92 | + - name: Generate Code Coverage |
| 93 | + uses: actions-rs/tarpaulin@v0.1 |
83 | 94 | with:
|
84 |
| - command: clippy |
85 |
| - args: --no-default-features --workspace -- -D warnings |
| 95 | + args: --all-features |
| 96 | + |
| 97 | + - name: Upload Code Coverage |
| 98 | + uses: codecov/codecov-action@v1 |
0 commit comments