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: All-Features Tests
# Reusable workflow: referenced via `uses: ./.github/workflows/test-all-features.yaml`
# from both the PR-quality and push-to-main pipelines.
#
# The shared quality job runs `cargo test` with default features (= none), so
# every `#![cfg(feature = ...)]` test target compiles to empty there. This job
# closes that gap: it compiles and runs the whole workspace with all features
# (sqlite, emitter, http, grpc, ...). Broker/database tests self-skip when
# their service env vars (DATABASE_URL, NATS_URL, ...) are unset, so no
# service containers are needed here — the integration-* workflows cover those.
on:
workflow_call:
jobs:
all-features:
name: All-Features Tests
runs-on: ubuntu-latest
env:
CARGO_TERM_COLOR: always
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8
with:
toolchain: stable
# --all-features compiles rdkafka; librdkafka's bundled cmake build needs
# curl/curl.h (the runner has libcurl's runtime but not its headers).
- name: Install librdkafka build dependencies
run: sudo apt-get update && sudo apt-get install -y libcurl4-openssl-dev
- name: Run workspace tests with all features
run: cargo test --workspace --all-features --all-targets --verbose
each-feature:
name: Each-Feature Check
runs-on: ubuntu-latest
env:
CARGO_TERM_COLOR: always
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8
with:
toolchain: stable
- uses: taiki-e/install-action@cargo-hack
# The kafka feature alone compiles rdkafka; see above.
- name: Install librdkafka build dependencies
run: sudo apt-get update && sudo apt-get install -y libcurl4-openssl-dev
# Catches missing cfg fences: only the no-features and all-features
# combinations are compiled elsewhere in CI.
- name: Check each feature in isolation
run: cargo hack check --workspace --each-feature --verbose