chore: run all tests in ci without "local" feature (#761)
This commit is contained in:
parent
f89e412200
commit
baf22d37bb
2 changed files with 44 additions and 1 deletions
34
.github/workflows/ci.yml
vendored
34
.github/workflows/ci.yml
vendored
|
|
@ -98,6 +98,40 @@ jobs:
|
|||
- name: Run tests
|
||||
run: cargo test --all-features
|
||||
|
||||
test-no-local:
|
||||
name: Run Tests (no local feature)
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
# install nodejs
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: '20'
|
||||
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v7
|
||||
|
||||
- name: Install Rust
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
|
||||
- name: Set up Python
|
||||
run: uv python install
|
||||
|
||||
- name: Create venv for python
|
||||
run: uv venv
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
|
||||
- name: Run tests without local feature
|
||||
run: |
|
||||
FEATURES=$(cargo metadata --no-deps --format-version 1 \
|
||||
| jq -r '[.packages[] | select(.name == "rmcp") | .features | keys[]
|
||||
| select(startswith("__") | not)
|
||||
| select(. != "local")] | join(",")')
|
||||
cargo test -p rmcp --features "$FEATURES"
|
||||
|
||||
coverage:
|
||||
name: Code Coverage
|
||||
runs-on: ubuntu-latest
|
||||
|
|
|
|||
9
justfile
9
justfile
|
|
@ -10,6 +10,15 @@ fix: fmt
|
|||
|
||||
test:
|
||||
cargo test --all-features
|
||||
if command -v jq > /dev/null 2>&1; then \
|
||||
FEATURES=$(cargo metadata --no-deps --format-version 1 \
|
||||
| jq -r '[.packages[] | select(.name == "rmcp") | .features | keys[] \
|
||||
| select(startswith("__") | not) \
|
||||
| select(. != "local")] | join(",")') && \
|
||||
cargo test -p rmcp --features "$FEATURES"; \
|
||||
else \
|
||||
echo "warning: jq not found, skipping non-local feature tests"; \
|
||||
fi
|
||||
|
||||
cov:
|
||||
cargo llvm-cov --lcov --output-path {{justfile_directory()}}/target/llvm-cov-target/coverage.lcov
|
||||
Loading…
Reference in a new issue