Skip to content

Commit 479b20f

Browse files
authored
chore: improve github actions (#104)
Signed-off-by: koushiro <koushiro.cqx@gmail.com>
1 parent 2d7cd35 commit 479b20f

File tree

2 files changed

+43
-27
lines changed

2 files changed

+43
-27
lines changed

.github/codecov.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
coverage:
2+
status:
3+
patch: off

.github/workflows/build.yml

Lines changed: 40 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,98 @@
1-
on: [push, pull_request]
2-
31
name: build
42

3+
on: [push, pull_request]
4+
55
jobs:
66
build:
7-
name: Lints and Test
7+
name: Build
88
strategy:
9+
fail-fast: false
910
matrix:
1011
platform: [ubuntu-latest, macos-latest, windows-latest]
1112
toolchain: [stable]
1213
runs-on: ${{ matrix.platform }}
1314

1415
steps:
15-
- name: Checkout sources
16+
- name: Checkout Sources
1617
uses: actions/checkout@v2
1718

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
1926
uses: actions-rs/toolchain@v1
2027
with:
2128
profile: minimal
2229
toolchain: ${{ matrix.toolchain }}
2330
override: true
2431
components: rustfmt, clippy
2532

26-
- name: Run cargo fmt
33+
- name: Check Code Format
2734
uses: actions-rs/cargo@v1
2835
with:
2936
command: fmt
3037
args: --all -- --check
3138

32-
- name: Run cargo clippy
39+
- name: Code Lint
3340
uses: actions-rs/cargo@v1
3441
with:
3542
command: clippy
3643
args: --all-targets --all-features --workspace -- -D warnings
3744

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
3952
uses: actions-rs/cargo@v1
4053
with:
4154
command: test
4255
args: --all-features --workspace
4356

44-
coverage:
45-
name: Code Coverage
57+
ensure_no_std:
58+
name: Ensure no_std
4659
runs-on: ubuntu-latest
4760
steps:
48-
- name: Checkout sources
61+
- name: Checkout Sources
4962
uses: actions/checkout@v2
5063

51-
- name: Install stable Rust toolchain
64+
- name: Install Rust Toolchain
5265
uses: actions-rs/toolchain@v1
5366
with:
5467
profile: minimal
5568
toolchain: stable
5669
override: true
70+
target: thumbv6m-none-eabi
5771

58-
- name: Run cargo-tarpaulin
59-
uses: actions-rs/tarpaulin@v0.1
72+
- name: Build
73+
uses: actions-rs/cargo@v1
6074
with:
61-
args: '--all-features -- --test-threads 1'
75+
command: build
76+
args: --no-default-features --workspace --target thumbv6m-none-eabi
6277

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
6880
runs-on: ubuntu-latest
6981
steps:
70-
- name: Checkout sources
82+
- name: Checkout Sources
7183
uses: actions/checkout@v2
7284

73-
- name: Install Rust toolchain
85+
- name: Install Rust Toolchain
7486
uses: actions-rs/toolchain@v1
7587
with:
7688
profile: minimal
7789
toolchain: stable
7890
override: true
79-
components: clippy
8091

81-
- name: Run cargo clippy
82-
uses: actions-rs/cargo@v1
92+
- name: Generate Code Coverage
93+
uses: actions-rs/tarpaulin@v0.1
8394
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

Comments
 (0)