Files
adam 3256167f48 test: add PTY integration test harness
Add a pty-mock workspace crate (echo/alt-screen/paste-echo/buffer-fill/
sync-blocks subcommands) plus an in-process integration test suite that
drives Proxy directly via a new_for_test constructor and #[cfg(test)]
state accessors. Sets up the regression net needed before swapping the
underlying VT emulator from vt100 to termwiz.

Pulled from upstream draft PR #35; the alt-screen feed-order semantic
change is intentionally deferred (its dedicated test is left #[ignore]).
2026-05-01 17:11:08 +00:00

108 lines
2.7 KiB
YAML

name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
env:
CARGO_TERM_COLOR: always
jobs:
version-badge:
name: Version Badge
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check version badge matches Cargo.toml
run: |
CARGO_VERSION=$(grep '^version = ' Cargo.toml | head -1 | sed 's/version = "\(.*\)"/\1/')
BADGE_VERSION=$(grep -oP 'badge/version-\K[0-9]+\.[0-9]+\.[0-9]+' README.md | head -1)
if [ "$CARGO_VERSION" != "$BADGE_VERSION" ]; then
echo "Version mismatch: Cargo.toml=$CARGO_VERSION README badge=$BADGE_VERSION"
exit 1
fi
echo "Version badge matches: $CARGO_VERSION"
check:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo check --all-targets
fmt:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- run: cargo fmt --all --check
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- run: cargo clippy --all-targets --all-features -- -D warnings
test-matrix:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo build -p pty-mock
- run: cargo test --all-targets
test:
name: Test
runs-on: ubuntu-latest
needs: test-matrix
if: always()
steps:
- run: |
if [[ "${{ needs.test-matrix.result }}" != "success" ]]; then
exit 1
fi
integration:
name: Integration Tests
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Install expect (Linux)
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y expect
- name: Install expect (macOS)
if: runner.os == 'macOS'
run: command -v expect || brew install expect
- run: cargo build
- run: expect tests/integration.exp
nix-build:
name: Nix Build
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v31
- run: nix build .# -L