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
36
.github/workflows/ci.yml
vendored
36
.github/workflows/ci.yml
vendored
|
|
@ -97,7 +97,41 @@ jobs:
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: cargo test --all-features
|
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:
|
coverage:
|
||||||
name: Code Coverage
|
name: Code Coverage
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
|
||||||
9
justfile
9
justfile
|
|
@ -10,6 +10,15 @@ fix: fmt
|
||||||
|
|
||||||
test:
|
test:
|
||||||
cargo test --all-features
|
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:
|
cov:
|
||||||
cargo llvm-cov --lcov --output-path {{justfile_directory()}}/target/llvm-cov-target/coverage.lcov
|
cargo llvm-cov --lcov --output-path {{justfile_directory()}}/target/llvm-cov-target/coverage.lcov
|
||||||
Loading…
Reference in a new issue