-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (59 loc) · 2.55 KB
/
Copy pathci.yml
File metadata and controls
63 lines (59 loc) · 2.55 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
name: ci
on:
push:
branches: [main]
pull_request:
env:
CARGO_TERM_COLOR: always
jobs:
build-test:
runs-on: ubuntu-latest
# Cap the job: a normal run is well under 10m even on a cold cache. A hung
# test (the cluster suite can starve on a 2-core runner) must fail fast here,
# not burn the full 6h GitHub default before being cancelled.
timeout-minutes: 25
steps:
- uses: actions/checkout@v5
- name: Install native build deps
# capnproto: ledge-rpc codegen. cmake + clang: aws-lc-rs (rustls provider).
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends capnproto cmake clang
- name: Resolve pinned toolchain
id: toolchain
# Single source of truth: read the channel from rust-toolchain.toml so CI
# cannot drift from local/Docker. Bump the toml, never this workflow.
run: |
channel=$(grep -m1 '^channel' rust-toolchain.toml | cut -d'"' -f2)
echo "channel=$channel" >> "$GITHUB_OUTPUT"
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ steps.toolchain.outputs.channel }}
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
- name: Format
run: cargo fmt --all --check
- name: Clippy
run: cargo clippy --workspace --all-targets -- -D warnings
# Everything except the cluster crate runs with default parallelism.
- name: Test
run: cargo test --workspace --exclude ledge-cluster
# The ledge-cluster integration tests each spin up a multi-node Raft
# cluster. Running several at once on the 2-core runner starves their
# election timers into a livelock, and even serialized a single cluster op
# can occasionally wedge under extreme starvation (observed ~22m hangs).
# Serialize them (--test-threads=1) so only one cluster runs at a time, and
# wrap in `timeout` so a wedge fails FAST (≤10m) instead of silently eating
# the whole 25m job — a wedge is then a quick, clearly-attributable red to
# re-run, not a budget-burning stall. Normal run is ~2-3m (compile + run).
# A proper root fix (bounded client-op waits in the testkit, or a
# cargo-nextest per-test timeout) is a tracked follow-up.
- name: Test (cluster, serialized)
run: timeout 600 cargo test -p ledge-cluster -- --test-threads=1
docker:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v5
- name: Build image
run: docker build -t ledge:ci .