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
name: CI
on:
push:
branches:
pull_request:
env:
CARGO_TERM_COLOR: always
jobs:
test:
# The console drives a terminal, but every test in the suite runs headless:
# the view tests build a real Terminal over an in-memory backend, and the
# protocol tests bind ephemeral loopback ports. No TTY is required.
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
- name: Format
run: cargo fmt --all -- --check
- name: Clippy
run: cargo clippy --all-targets -- -D warnings
- name: Test
run: cargo test --all-targets
# The protocol suite is concurrent -- threads per connection, sessions
# reaped on a timer, a self-connect used to wake a blocked accept. A race
# here would surface as a rare CI failure nobody can reproduce, so it is
# run repeatedly rather than once.
- name: Protocol suite, repeated
run: for i in $(seq 10); do cargo test --test protocol || exit 1; done