-
Notifications
You must be signed in to change notification settings - Fork 0
129 lines (119 loc) · 4.04 KB
/
Copy pathtui-ci.yml
File metadata and controls
129 lines (119 loc) · 4.04 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: tui-ci
# Scoped to apps/tui so the Rust toolchain only spins up when the terminal
# reader actually changes.
on:
push:
branches: [main, master]
paths:
- "apps/tui/**"
- "skills/setup-readio/**"
- ".github/workflows/tui-ci.yml"
- ".github/workflows/tui-release.yml"
pull_request:
paths:
- "apps/tui/**"
- "skills/setup-readio/**"
- ".github/workflows/tui-ci.yml"
- ".github/workflows/tui-release.yml"
env:
CARGO_TERM_COLOR: always
defaults:
run:
working-directory: apps/tui
jobs:
test:
name: test (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-15, ubuntu-latest]
steps:
- uses: actions/checkout@v4
- run: rustup update stable --no-self-update && rustup component add rustfmt clippy
- uses: Swatinem/rust-cache@v2
with:
workspaces: apps/tui
# The resident-worker tests use tiny fake MLX models, but exercise the
# real NumPy WAV conversion and Hugging Face disk-space preflight.
- name: Install worker test dependencies
run: |
python3 -m venv "${RUNNER_TEMP}/readio-worker-tests"
"${RUNNER_TEMP}/readio-worker-tests/bin/python" -m pip install \
--disable-pip-version-check \
"numpy>=1.26,<3" \
"huggingface_hub>=0.27,<2"
echo "${RUNNER_TEMP}/readio-worker-tests/bin" >> "${GITHUB_PATH}"
- name: Format
run: cargo fmt --check
- name: Lint
run: cargo clippy --all-targets -- -D warnings
- name: Test
run: cargo test --locked
# The interesting failures live in a real terminal: raw mode, the
# alternate screen, and whether the terminal is restored on exit.
- name: Terminal smoke test
run: |
cargo build --release --locked
python3 scripts/pty_probe.py 96 24 "wait:0.6,type:/sample,key:enter,wait:2" \
--home "${{ runner.temp }}/readio-ci" | tee /tmp/probe.txt
grep -q "\[exit: clean\]" /tmp/probe.txt
grep -q "\[alt-screen restored: True\]" /tmp/probe.txt
shell:
name: installer
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Shellcheck
run: shellcheck --shell=sh scripts/install.sh scripts/test-release-workflow.sh scripts/test-setup-skill.sh
- name: Help works under dash
run: dash scripts/install.sh --help
- name: Release workflow contract
run: sh scripts/test-release-workflow.sh
- name: Setup skill contract
run: sh scripts/test-setup-skill.sh
windows:
name: windows installer
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- run: rustup update stable --no-self-update
- uses: Swatinem/rust-cache@v2
with:
workspaces: apps/tui
key: windows-msvc
cache-on-failure: true
- name: Build and run the Windows binary
shell: pwsh
run: |
cargo build --locked
& target/debug/readio.exe --version
& target/debug/readio.exe --help
- name: Test the PowerShell installer end to end
shell: pwsh
run: ./scripts/test-install.ps1 -Binary target/debug/readio.exe
portable:
name: release target (${{ matrix.target }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-musl
os: ubuntu-latest
- target: aarch64-unknown-linux-musl
os: ubuntu-24.04-arm
steps:
- uses: actions/checkout@v4
- name: Install Rust and musl tooling
run: |
rustup update stable --no-self-update
rustup target add ${{ matrix.target }}
sudo apt-get update
sudo apt-get install -y musl-tools
- uses: Swatinem/rust-cache@v2
with:
workspaces: apps/tui
key: ${{ matrix.target }}
- name: Build the release target
run: cargo build --release --locked --target ${{ matrix.target }}