-
Notifications
You must be signed in to change notification settings - Fork 9
40 lines (35 loc) · 918 Bytes
/
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
name: Rust CI
on:
push:
branches:
- main
- dev # 在 push 到 main 或 dev 分支时触发
pull_request:
branches:
- main
- dev # 在拉取请求到 main 或 dev 分支时触发
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Install Cargo Tarpaulin
run: cargo install cargo-tarpaulin
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
- name: Run cargo-tarpaulin
run: cargo tarpaulin --out Xml
- name: Run cargo-audit
run: cargo install cargo-audit && cargo-audit audit
- name: Upload coverage to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}