-
Notifications
You must be signed in to change notification settings - Fork 253
90 lines (77 loc) · 2.04 KB
/
rust-test.yml
File metadata and controls
90 lines (77 loc) · 2.04 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
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
name: Rust Tests
permissions:
contents: read
on:
pull_request:
paths:
- 'client/**'
- 'proto/**'
- 'Cargo.toml'
- 'Cargo.lock'
- '.github/workflows/rust-*.yml'
push:
branches:
- main
- release/*
paths:
- 'client/**'
- 'proto/**'
- 'Cargo.toml'
- 'Cargo.lock'
- '.github/workflows/rust-*.yml'
jobs:
test:
name: Test Rust Client
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
- beta
- nightly
steps:
- name: Checkout code
uses: actions/checkout@v6.0.2
- name: Setup Rust
uses: ./.github/actions/rust-setup
with:
toolchain: ${{ matrix.rust }}
components: rustfmt, clippy
cache-key: test
- name: Build
run: cargo build --workspace --all-features --verbose
- name: Run tests
run: cargo test --workspace --all-features --verbose
- name: Run doc tests
run: cargo test --workspace --doc --verbose
- name: Check examples
run: |
cd client/crates/client
cargo check --examples --verbose
coverage:
name: Code Coverage
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- name: Checkout code
uses: actions/checkout@v6.0.2
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools-preview
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Install protoc
uses: arduino/setup-protoc@v3
with:
version: "25.1"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Generate code coverage
run: cargo llvm-cov --workspace --lcov --output-path lcov.info
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
files: lcov.info
flags: rust
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}