-
Notifications
You must be signed in to change notification settings - Fork 6
75 lines (69 loc) · 2.21 KB
/
test.yml
File metadata and controls
75 lines (69 loc) · 2.21 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
# Reusable test workflow: fmt, clippy, and full test suite.
#
# Called by:
# - ci.yml (PR checks)
# - release.yml (pre-publish gate)
name: Test
on:
workflow_call:
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
jobs:
lint:
name: Lint & Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
with:
prefix-key: lint
- name: Install system deps
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
cmake clang libclang-dev pkg-config protobuf-compiler perl \
libcurl4-openssl-dev libsasl2-dev
- name: Check formatting
run: cargo fmt --all -- --check
- name: Run clippy
run: cargo clippy --workspace --all-targets --all-features --profile ci -- -D warnings
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
prefix-key: test
- name: Install system deps
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
cmake clang libclang-dev pkg-config protobuf-compiler perl \
libcurl4-openssl-dev libsasl2-dev
# nextest is required — `.config/nextest.toml` defines the
# `cluster` test-group that serializes 3-node integration tests
# and the `ci` profile that retries flaky cluster tests once and
# writes a JUnit report. Plain `cargo test` ignores all of that
# and will hang/fail on the cluster suite.
- name: Install cargo-nextest
uses: taiki-e/install-action@v2
with:
tool: nextest
- name: Run tests
run: cargo nextest run --all-features --cargo-profile ci --profile ci
- name: Upload JUnit report
if: always()
uses: actions/upload-artifact@v4
with:
name: junit-report
path: target/nextest/ci/junit.xml
if-no-files-found: ignore