Files
mcfn.feng 58545129de [root]refactor: remove actionbook-rs, promote cli-v2 to packages/cli
- Delete packages/actionbook-rs/ (legacy 0.x CLI)
- Delete old packages/cli/ (JS npm wrapper for 0.x)
- Rename packages/cli-v2/ → packages/cli/ (git mv)
- Merge npm wrapper files (bin/actionbook.js, scripts/postinstall.js) into new cli/
- Update package.json: name → @actionbookdev/cli, private → false, add npm distribution fields
- Update sync-versions.js: point Cargo.toml/Cargo.lock sync at packages/cli/
- Update release.yml: build from packages/cli/ instead of packages/actionbook-rs/
- Update test.yml: paths and working-directory from cli-v2 → cli
- Update CLAUDE.md, CONTRIBUTING.md, docs, issue templates
- Delete stale changeset (fix-screenshot-timeout.md)
- Keep 6 platform binary packages unchanged
2026-04-02 00:46:12 +08:00

103 lines
2.3 KiB
YAML

name: Tests (cli)
on:
push:
branches: [main, "release/**"]
paths:
- "packages/cli/**"
pull_request:
branches: [main, "release/**"]
paths:
- "packages/cli/**"
env:
CARGO_TERM_COLOR: always
permissions:
contents: read
checks: write
jobs:
lint:
name: Lint (fmt + clippy)
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Cache cargo registry & build
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
packages/cli/target
key: ${{ runner.os }}-cargo-lint-${{ hashFiles('packages/cli/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-lint-
- name: Check formatting
working-directory: packages/cli
run: cargo fmt --all -- --check
- name: Run clippy
working-directory: packages/cli
run: cargo clippy --all-targets -- -D warnings
unit-tests:
name: Unit Tests
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache Rust build
uses: Swatinem/rust-cache@v2
with:
workspaces: packages/cli
shared-key: unit-tests
- name: Run unit tests
working-directory: packages/cli
run: cargo test --lib
e2e-tests:
name: E2E Tests
# Only run on merge to main/release branches, not on PRs
if: github.event_name == 'push'
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache Rust build
uses: Swatinem/rust-cache@v2
with:
workspaces: packages/cli
shared-key: e2e-tests
- name: Install Chrome
uses: browser-actions/setup-chrome@v1
with:
chrome-version: stable
- name: Run E2E tests
working-directory: packages/cli
env:
RUN_E2E_TESTS: "true"
run: cargo test --test e2e