Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 50 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ jobs:
run: cargo deny check

test:
name: Test (${{ matrix.os }}${{ matrix.target && format(' / {0}', matrix.target) || '' }})
name: Test (${{ matrix.os }}${{ matrix.rust != 'stable' && format(' / {0}', matrix.rust) || '' }})
needs: [changes, fmt, check]
if: needs.changes.outputs.rust == 'true' || needs.changes.outputs.workflows == 'true'
runs-on: ${{ matrix.os }}
Expand All @@ -123,29 +123,55 @@ jobs:
include:
- os: ubuntu-latest
rust: beta

steps:
- uses: actions/checkout@v6

- uses: moonrepo/setup-rust@v1
with:
channel: ${{ matrix.rust }}
bins: cargo-nextest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install dependencies (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libssl-dev pkg-config

- name: Run tests
run: cargo nextest run --workspace --all-features --no-fail-fast

- name: Run doctests
run: cargo test --workspace --doc --all-features

cross-check:
name: Cross-compile Check (${{ matrix.target }})
needs: [changes, fmt, check]
if: needs.changes.outputs.rust == 'true' || needs.changes.outputs.workflows == 'true'
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
rust: stable
target: aarch64-pc-windows-msvc
cross: true
use_cross_tool: false
- os: ubuntu-latest
rust: stable
target: x86_64-unknown-linux-musl
cross: true
use_cross_tool: true
- os: ubuntu-latest
rust: stable
target: aarch64-unknown-linux-musl
cross: true
use_cross_tool: true

steps:
- uses: actions/checkout@v6

- uses: moonrepo/setup-rust@v1
with:
channel: ${{ matrix.rust }}
targets: ${{ matrix.target }}
bins: ${{ !matrix.cross && 'cargo-nextest' || '' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -159,16 +185,8 @@ jobs:
if: matrix.use_cross_tool
uses: taiki-e/install-action@cross

- name: Run tests
if: ${{ !matrix.cross }}
run: cargo nextest run --workspace --all-features --no-fail-fast

- name: Run doctests
if: ${{ !matrix.cross }}
run: cargo test --workspace --doc --all-features

- name: Build for cross-compile target
if: ${{ matrix.cross && !matrix.use_cross_tool }}
if: ${{ !matrix.use_cross_tool }}
run: cargo build --workspace --target ${{ matrix.target }}

- name: Build for cross-compile target (musl via cross)
Expand Down Expand Up @@ -300,7 +318,19 @@ jobs:

ci-success:
name: CI Success
needs: [changes, fmt, check, security, test, coverage, msrv, wasm, benchmark]
needs:
[
changes,
fmt,
check,
security,
test,
cross-check,
coverage,
msrv,
wasm,
benchmark,
]
runs-on: ubuntu-latest
if: always()
steps:
Expand All @@ -326,6 +356,7 @@ jobs:
check_job "${{ needs.check.result }}" "check" || failed=1
check_job "${{ needs.security.result }}" "security" || failed=1
check_job "${{ needs.test.result }}" "test" || failed=1
check_job "${{ needs.cross-check.result }}" "cross-check" || failed=1
check_job "${{ needs.coverage.result }}" "coverage" || failed=1
check_job "${{ needs.msrv.result }}" "msrv" || failed=1
check_job "${{ needs.wasm.result }}" "wasm" || failed=1
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed
- **CI**: the `test` job's matrix `include` entries for `x86_64-unknown-linux-musl` and `aarch64-unknown-linux-musl` matched the same base `(ubuntu-latest, stable)` combination, so the second silently overwrote the first — `x86_64-unknown-linux-musl` was never actually checked in CI. Cross-compile checks (both musl targets plus `aarch64-pc-windows-msvc`) now run in a dedicated `cross-check` job with no shared base matrix axis, so `include` entries can no longer collide (resolves #109)
- **tests**: native Windows test runs were never exercised in CI (the `windows-latest`/stable slot was always absorbed by the `aarch64-pc-windows-msvc` cross-compile job above), which hid that most test fixtures built `Uri`s from Unix-style absolute paths — not recognized as absolute on Windows, causing `Uri::from_file_path(...).unwrap()` to panic. Added `deps_core::test_util::test_uri`, a cross-platform test helper (feature-gated via `test-util`), and switched all executed test/doctest call sites to it

## [0.9.5] - 2026-08-12

### Changed
Expand Down
1 change: 1 addition & 0 deletions crates/deps-bundler/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ tracing = { workspace = true }
urlencoding = { workspace = true }

[dev-dependencies]
deps-core = { workspace = true, features = ["test-util"] }
criterion = { workspace = true, features = ["html_reports"] }
insta = { workspace = true, features = ["json"] }
tempfile = { workspace = true }
Expand Down
1 change: 1 addition & 0 deletions crates/deps-cargo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ tracing = { workspace = true }
urlencoding = { workspace = true }

[dev-dependencies]
deps-core = { workspace = true, features = ["test-util"] }
criterion = { workspace = true, features = ["html_reports"] }
insta = { workspace = true, features = ["json"] }
tempfile = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion crates/deps-cargo/src/ecosystem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ mod tests {

fn uri(&self) -> &Uri {
static URI: std::sync::LazyLock<Uri> =
std::sync::LazyLock::new(|| Uri::from_file_path("/test/Cargo.toml").unwrap());
std::sync::LazyLock::new(|| deps_core::test_util::test_uri("/test/Cargo.toml"));
&URI
}

Expand Down
1 change: 1 addition & 0 deletions crates/deps-composer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@ tracing = { workspace = true }
urlencoding = { workspace = true }

[dev-dependencies]
deps-core = { workspace = true, features = ["test-util"] }
tempfile = { workspace = true }
tokio = { workspace = true, features = ["macros", "rt-multi-thread"] }
8 changes: 4 additions & 4 deletions crates/deps-composer/src/ecosystem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ mod tests {
async fn test_parse_manifest_valid() {
let cache = Arc::new(deps_core::HttpCache::new());
let ecosystem = ComposerEcosystem::new(cache);
let uri = Uri::from_file_path("/test/composer.json").unwrap();
let uri = deps_core::test_util::test_uri("/test/composer.json");

let content = r#"{"require": {"symfony/console": "^6.0"}}"#;
let result = ecosystem.parse_manifest(content, &uri).await;
Expand All @@ -177,7 +177,7 @@ mod tests {
async fn test_parse_manifest_invalid() {
let cache = Arc::new(deps_core::HttpCache::new());
let ecosystem = ComposerEcosystem::new(cache);
let uri = Uri::from_file_path("/test/composer.json").unwrap();
let uri = deps_core::test_util::test_uri("/test/composer.json");

let result = ecosystem.parse_manifest("{invalid json}", &uri).await;
assert!(result.is_err());
Expand All @@ -196,7 +196,7 @@ mod tests {
async fn test_generate_inlay_hints_empty() {
let cache = Arc::new(deps_core::HttpCache::new());
let ecosystem = ComposerEcosystem::new(cache);
let uri = Uri::from_file_path("/test/composer.json").unwrap();
let uri = deps_core::test_util::test_uri("/test/composer.json");

let content = r#"{"require": {}}"#;
let parse_result = ecosystem.parse_manifest(content, &uri).await.unwrap();
Expand All @@ -218,7 +218,7 @@ mod tests {
async fn test_generate_completions_no_context() {
let cache = Arc::new(deps_core::HttpCache::new());
let ecosystem = ComposerEcosystem::new(cache);
let uri = Uri::from_file_path("/test/composer.json").unwrap();
let uri = deps_core::test_util::test_uri("/test/composer.json");

let content = r#"{"name": "test/project"}"#;
let parse_result = ecosystem.parse_manifest(content, &uri).await.unwrap();
Expand Down
2 changes: 1 addition & 1 deletion crates/deps-composer/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ mod tests {
use super::*;

fn test_uri() -> Uri {
Uri::from_file_path("/test/composer.json").unwrap()
deps_core::test_util::test_uri("/test/composer.json")
}

#[test]
Expand Down
6 changes: 6 additions & 0 deletions crates/deps-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ publish = true
[lints]
workspace = true

[features]
# Exposes `test_util` to other workspace crates' own test builds, where
# `cfg(test)` alone would not apply (deps-core is a normal, non-dev
# dependency there).
test-util = []

[dependencies]
async-trait = { workspace = true }
bytes = { workspace = true }
Expand Down
4 changes: 2 additions & 2 deletions crates/deps-core/src/ecosystem_registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -412,11 +412,11 @@ mod tests {

registry.register(ecosystem);

let uri = Uri::from_file_path("/home/user/project/test.toml").unwrap();
let uri = crate::test_util::test_uri("/home/user/project/test.toml");
let retrieved = registry.get_for_uri(&uri).unwrap();
assert_eq!(retrieved.id(), "test");

let unknown_uri = Uri::from_file_path("/home/user/project/unknown.toml").unwrap();
let unknown_uri = crate::test_util::test_uri("/home/user/project/unknown.toml");
assert!(registry.get_for_uri(&unknown_uri).is_none());
}

Expand Down
2 changes: 2 additions & 0 deletions crates/deps-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ pub mod lsp_helpers;
pub mod macros;
pub mod parser;
pub mod registry;
#[cfg(any(test, feature = "test-util"))]
pub mod test_util;
pub mod version_matcher;

// Re-export commonly used types
Expand Down
Loading
Loading