Skip to content

Commit 1356285

Browse files
committed
chore(ci): check the Rust client on its own pull requests and on dev
1 parent 819929a commit 1356285

2 files changed

Lines changed: 19 additions & 9 deletions

File tree

‎.github/workflows/check-cli-rs.yml‎

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
name: check-cli-rs
22

3-
# Checks packages/cli-rs, the Rust client, which check-test.yml leaves out. Its tests compare it with the TypeScript
4-
# packages listed below, so a change there runs it too.
3+
# Checks packages/cli-rs, the Rust client, which check-test.yml leaves out. Pull requests run it only when they change
4+
# the client. Its tests and check:drift also compare it with the TypeScript packages below, so a dev push that changes
5+
# one runs it too: a TypeScript change that breaks the client shows on dev, not on other teams' pull requests.
56
on:
67
pull_request:
7-
paths: &paths
8+
paths:
9+
- packages/cli-rs/**
10+
- .github/workflows/check-cli-rs.yml
11+
push:
12+
branches: [dev]
13+
paths:
814
- packages/cli-rs/**
915
- packages/cli/src/**
1016
- packages/client/**
@@ -16,9 +22,6 @@ on:
1622
- packages/util/**
1723
- bun.lock
1824
- .github/workflows/check-cli-rs.yml
19-
push:
20-
branches: [dev]
21-
paths: *paths
2225
workflow_dispatch:
2326

2427
permissions:
@@ -37,10 +40,12 @@ jobs:
3740
working-directory: packages/cli-rs
3841
steps:
3942
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
40-
# Bun and node_modules: the tests run the TypeScript side they compare against.
43+
# Bun and node_modules: the tests and check:drift run the TypeScript side they compare against.
4144
- uses: ./.github/actions/setup-bun
4245
# rustup reads rust-toolchain.toml; `bun run cargo` first fetches OpenTUI's native library from its release.
4346
- run: rustup toolchain install
4447
- run: bun run cargo fmt --check
4548
- run: bun run cargo clippy --locked --workspace --all-targets -- -D warnings
4649
- run: bun run cargo test --locked --workspace
50+
# Fails until the cli-rs port PR (native-next-12) lands: dev lacks the files it regenerates.
51+
- run: bun run check:drift

‎packages/cli-rs/AGENTS.md‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,17 @@ say "native"; crates, this directory, and `OPENCODE_RS_*` variables say "rs".
1414

1515
## Checks
1616

17-
Before merging, the whole package must pass:
17+
CI (`.github/workflows/check-cli-rs.yml`) runs:
1818

1919
- `bun run cargo fmt --check`
2020
- `bun run cargo clippy --locked --workspace --all-targets -- -D warnings`
21-
- `bun run cargo test --locked --workspace --no-fail-fast`
21+
- `bun run cargo test --locked --workspace`
2222
- `bun run check:drift`
23+
24+
CI has no `opencode` binary, so a few tests that need one skip. Before merging, also run these locally:
25+
26+
- `OPENCODE_RS_REQUIRE_TS=1 bun run cargo test --locked --workspace --no-fail-fast`, with an `opencode` binary on
27+
`PATH`. Then the TypeScript interop tests fail instead of skipping.
2328
- `bun run parity:machines`
2429

2530
Each of `opencode-tui` and `opencode-ui` has one integration test binary, `tests/all/main.rs`, with one module per

0 commit comments

Comments
 (0)