-
Notifications
You must be signed in to change notification settings - Fork 71
109 lines (95 loc) · 2.81 KB
/
rust.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: Rust
on:
pull_request:
paths:
- rust/**
- .github/workflows/rust.yml
push:
branches:
- master
permissions:
contents: read
concurrency:
group: rust-ci-${{ github.ref }}
cancel-in-progress: true
jobs:
fmt:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Check formatting
working-directory: ./rust
run: cargo fmt -- --check
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: taiki-e/install-action@cargo-hack
- name: Clippy (features powerset)
working-directory: ./rust
run: cargo hack clippy --feature-powerset --no-dev-deps -- -D warnings
- name: Clippy (features powerset, tests)
working-directory: ./rust
run: cargo hack clippy --tests --feature-powerset -- -D warnings
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Check all target in std
working-directory: ./rust
run: cargo check --all
- name: Check all target in no_std
working-directory: ./rust
run: cargo check --no-default-features --all
- name: Build all targets in std
working-directory: ./rust
run: cargo build --all --all-targets
- name: Build all targets in no_std
working-directory: ./rust
run: cargo build --all --no-default-features
- name: Run all tests with no-std
working-directory: ./rust
run: cargo test --all --no-default-features
- name: Run all tests with std
working-directory: ./rust
run: cargo test --all
- name: Check no_std compatibility
run: cd rust/no-std-check/; make setup; make all
coverage:
name: Code Coverage
runs-on: ubuntu-latest
env:
CARGO_TERM_COLOR: always
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Install cargo-nextest
uses: taiki-e/install-action@nextest
- name: Generate code coverage
working-directory: ./rust
run: cargo llvm-cov nextest --all-features --lcov --output-path lcov.info
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: rust/lcov.info
flags: rust
fail_ci_if_error: true