返回 DeepSeek-TUI-2026
ci.yml
根目录 / .github / workflows / ci.yml
1 name: CI
2
3 on:
4 push:
5 branches: [master, main]
6 pull_request:
7 branches: [master, main]
8 schedule:
9 - cron: '31 6 * * 1'
10
11 env:
12 CARGO_TERM_COLOR: always
13 RUSTFLAGS: -Dwarnings
14
15 jobs:
16 versions:
17 name: Version drift
18 runs-on: ubuntu-latest
19 steps:
20 - uses: actions/checkout@v4
21 - uses: dtolnay/rust-toolchain@stable
22 - name: Install Linux system dependencies
23 if: runner.os == 'Linux'
24 run: |
25 for i in 1 2 3 4 5; do
26 sudo apt-get update && break
27 echo "apt-get update failed (attempt $i); retrying in 15s"
28 sleep 15
29 done
30 sudo apt-get install -y libdbus-1-dev pkg-config
31 - uses: actions/setup-node@v4
32 with:
33 node-version: 20
34 - name: Check version drift
35 run: ./scripts/release/check-versions.sh
36
37 lint:
38 name: Lint
39 runs-on: ubuntu-latest
40 steps:
41 - uses: actions/checkout@v4
42 - uses: dtolnay/rust-toolchain@stable
43 with:
44 components: clippy, rustfmt
45 - name: Install Linux system dependencies
46 if: runner.os == 'Linux'
47 run: |
48 for i in 1 2 3 4 5; do
49 sudo apt-get update && break
50 echo "apt-get update failed (attempt $i); retrying in 15s"
51 sleep 15
52 done
53 sudo apt-get install -y libdbus-1-dev pkg-config
54 - uses: Swatinem/rust-cache@v2
55 - name: Check formatting
56 run: cargo fmt --all -- --check
57 # Mirror the release-workflow `parity` gate exactly. Anything that
58 # would fail there must fail here so we never push a `v*` tag that
59 # the npm publish pipeline can't ship. The Release job runs with
60 # `--locked` + `-D warnings`; we do the same.
61 - name: Clippy (release-strict)
62 run: cargo clippy --workspace --all-targets --all-features --locked -- -D warnings
63
64 test:
65 name: Test
66 runs-on: ${{ matrix.os }}
67 strategy:
68 matrix:
69 os: [ubuntu-latest, macos-latest, windows-latest]
70 steps:
71 - uses: actions/checkout@v4
72 - uses: dtolnay/rust-toolchain@stable
73 - name: Install Linux system dependencies
74 if: runner.os == 'Linux'
75 run: |
76 for i in 1 2 3 4 5; do
77 sudo apt-get update && break
78 echo "apt-get update failed (attempt $i); retrying in 15s"
79 sleep 15
80 done
81 sudo apt-get install -y libdbus-1-dev pkg-config
82 - uses: Swatinem/rust-cache@v2
83 - name: Run tests
84 run: cargo test --workspace --all-features --locked
85 - name: Lockfile drift guard
86 run: git diff --exit-code -- Cargo.lock
87 - name: Run Offline Eval Harness
88 run: cargo run -p deepseek-tui --all-features -- eval
89
90 npm-wrapper-smoke:
91 name: npm wrapper smoke
92 if: github.event_name != 'schedule'
93 runs-on: ${{ matrix.os }}
94 strategy:
95 matrix:
96 os: ${{ fromJSON(github.event_name == 'pull_request' && '["ubuntu-latest"]' || '["ubuntu-latest","macos-latest","windows-latest"]') }}
97 steps:
98 - uses: actions/checkout@v4
99 - uses: dtolnay/rust-toolchain@stable
100 - name: Install Linux system dependencies
101 if: runner.os == 'Linux'
102 run: |
103 for i in 1 2 3 4 5; do
104 sudo apt-get update && break
105 echo "apt-get update failed (attempt $i); retrying in 15s"
106 sleep 15
107 done
108 sudo apt-get install -y libdbus-1-dev pkg-config
109 - uses: actions/setup-node@v4
110 with:
111 node-version: 20
112 - uses: Swatinem/rust-cache@v2
113 - name: Build wrapper binaries
114 run: cargo build --release --locked -p deepseek-tui-cli -p deepseek-tui
115 - name: Smoke wrapper install and delegated entrypoints
116 run: node scripts/release/npm-wrapper-smoke.js
117
118 # Check documentation builds without warnings
119 docs:
120 name: Documentation
121 if: github.event_name == 'schedule'
122 runs-on: ubuntu-latest
123 steps:
124 - uses: actions/checkout@v4
125 - uses: dtolnay/rust-toolchain@stable
126 - name: Install Linux system dependencies
127 if: runner.os == 'Linux'
128 run: |
129 for i in 1 2 3 4 5; do
130 sudo apt-get update && break
131 echo "apt-get update failed (attempt $i); retrying in 15s"
132 sleep 15
133 done
134 sudo apt-get install -y libdbus-1-dev pkg-config
135 - uses: Swatinem/rust-cache@v2
136 - name: Build docs
137 run: cargo doc --workspace --no-deps
138 env:
139 RUSTDOCFLAGS: -Dwarnings
140
140 lines YAML