0a394e1587
Adds scripts/release/check-versions.sh and a `versions` CI job that runs on every push/PR. Verifies: - no per-crate Cargo.toml carries a literal version (must inherit the workspace version) - npm/deepseek-tui/package.json matches the workspace version - Cargo.lock is in sync with the manifests Closes #31.
125 lines
3.6 KiB
YAML
125 lines
3.6 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [master, main]
|
|
pull_request:
|
|
branches: [master, main]
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
RUSTFLAGS: -Dwarnings
|
|
|
|
jobs:
|
|
versions:
|
|
name: Version drift
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
- name: Check version drift
|
|
run: ./scripts/release/check-versions.sh
|
|
|
|
lint:
|
|
name: Lint
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
components: clippy, rustfmt
|
|
- uses: Swatinem/rust-cache@v2
|
|
- name: Check formatting
|
|
run: cargo fmt --all -- --check
|
|
- name: Clippy
|
|
run: cargo clippy --workspace --all-targets --all-features
|
|
|
|
test:
|
|
name: Test
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
- uses: Swatinem/rust-cache@v2
|
|
- name: Run tests
|
|
run: cargo test --workspace --all-features
|
|
- name: Run Offline Eval Harness
|
|
run: cargo run -p deepseek-tui --all-features -- eval
|
|
|
|
build:
|
|
name: Build
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
- uses: Swatinem/rust-cache@v2
|
|
- name: Build
|
|
run: cargo build --release
|
|
|
|
npm-wrapper-smoke:
|
|
name: npm wrapper smoke
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
- uses: Swatinem/rust-cache@v2
|
|
- name: Build wrapper binaries
|
|
run: cargo build --release --locked -p deepseek-tui-cli -p deepseek-tui
|
|
- name: Prepare local release assets
|
|
run: node scripts/release/prepare-local-release-assets.js "$RUNNER_TEMP/release-assets"
|
|
- name: Start local release server
|
|
run: |
|
|
python3 -m http.server 8123 --directory "$RUNNER_TEMP/release-assets" >/tmp/deepseek-release-server.log 2>&1 &
|
|
sleep 1
|
|
- name: Pack npm wrapper
|
|
working-directory: npm/deepseek-tui
|
|
env:
|
|
DEEPSEEK_TUI_FORCE_DOWNLOAD: "1"
|
|
DEEPSEEK_TUI_RELEASE_BASE_URL: http://127.0.0.1:8123/
|
|
run: npm pack
|
|
- name: Install packed wrapper
|
|
env:
|
|
DEEPSEEK_TUI_FORCE_DOWNLOAD: "1"
|
|
DEEPSEEK_TUI_RELEASE_BASE_URL: http://127.0.0.1:8123/
|
|
run: |
|
|
mkdir -p "$RUNNER_TEMP/npm-smoke"
|
|
cd "$RUNNER_TEMP/npm-smoke"
|
|
npm init -y
|
|
npm install "$GITHUB_WORKSPACE/npm/deepseek-tui"/deepseek-tui-*.tgz
|
|
- name: Smoke wrapper entrypoints
|
|
env:
|
|
DEEPSEEK_TUI_FORCE_DOWNLOAD: "1"
|
|
DEEPSEEK_TUI_RELEASE_BASE_URL: http://127.0.0.1:8123/
|
|
run: |
|
|
cd "$RUNNER_TEMP/npm-smoke"
|
|
npx --no-install deepseek --help
|
|
npx --no-install deepseek-tui --help
|
|
|
|
# Check documentation builds without warnings
|
|
docs:
|
|
name: Documentation
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
- uses: Swatinem/rust-cache@v2
|
|
- name: Build docs
|
|
run: cargo doc --workspace --no-deps
|
|
env:
|
|
RUSTDOCFLAGS: -Dwarnings
|