-
Notifications
You must be signed in to change notification settings - Fork 2
54 lines (50 loc) · 1.52 KB
/
rust.yml
File metadata and controls
54 lines (50 loc) · 1.52 KB
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
name: Rust
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
CARGO_TERM_COLOR: always
jobs:
rust_fmt:
name: Formatting
runs-on: ubuntu-latest
steps:
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.3
- uses: actions/checkout@v3
- name: Run rust format
uses: actions-rs/toolchain@v1.0.6
with:
profile: minimal
default: true
components: rustfmt
- uses: Swatinem/rust-cache@v2.8.1
- run: cargo fmt -- --check
run_test:
name: Run tests
runs-on: ubuntu-latest
steps:
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.9
with:
version: "v0.10.0"
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2.8.1
- name: Install tarpaulin
run: |
curl -s https://api.github.com/repos/xd009642/tarpaulin/releases/latest | \
grep "browser_download_url.*x86_64-unknown-linux-musl.tar.gz" | cut -d : -f 2,3 | tr -d \" | wget -qi -
tar -xzf cargo-tarpaulin-*.tar.gz
mv cargo-tarpaulin ~/.cargo/bin/
- name: Run tests with tarpaulin
run: cargo tarpaulin --workspace --exclude tui --exclude shared --exclude db --out Xml
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: cobertura.xml
verbose: true