-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (41 loc) · 1.16 KB
/
Copy pathtests.yml
File metadata and controls
51 lines (41 loc) · 1.16 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
# SPDX-License-Identifier: Apache-2.0
name: Tests
on:
workflow_dispatch:
pull_request:
push:
branches:
- master
permissions:
contents: read
jobs:
test:
name: Rust tests and coverage
runs-on: ubuntu-latest
env:
CARGO_TERM_COLOR: always
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
run: rustup toolchain install
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Check formatting
run: cargo fmt --check
- name: Run clippy
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Run tests with coverage
run: cargo llvm-cov --workspace --codecov --remap-path-prefix --output-path codecov.json
- name: Upload coverage to Codecov
if: env.CODECOV_TOKEN != ''
uses: codecov/codecov-action@v5
with:
token: ${{ env.CODECOV_TOKEN }}
files: codecov.json
flags: rust
name: rust-coverage
disable_search: true
plugins: noop
fail_ci_if_error: true