File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -35,15 +35,17 @@ jobs:
3535 - name : Run Rust tests
3636 shell : bash
3737 run : |
38- # Get all workspace packages and filter out those starting with 'ruff'
39- packages=$(cargo metadata --format-version 1 --no-deps | \
40- jq -r '.workspace_members[]' | \
41- sed 's/.*\///' | \
42- grep -v '^ruff' | \
43- xargs)
4438 # Build cargo test command with -p flags for each package
45- # Format as `cargo test -p <package> -p <package> ...`
39+ # We do so because the ruff submodule also contains crates and those will
40+ # run if we don't limit the tests to only our packages.
41+ # And `cargo test` command doesn't allow to exclude crates based on patterns.
42+ #
43+ # 1. Get all directories in our `crates/` folder
44+ packages=$(find crates -maxdepth 1 -mindepth 1 -type d | \
45+ sed 's/crates\///' | \
46+ tr '\n' ' ')
4647 echo "Running tests for packages: $packages"
48+ # 2. Format as `cargo test -p <package> -p <package> ...`
4749 cargo test $(echo "$packages" | sed 's/\([^ ]*\)/-p \1/g')
4850
4951 # After Rust tests pass, run Python tests next
You can’t perform that action at this time.
0 commit comments