Skip to content

Commit 76ad82e

Browse files
committed
refactor: do not run tests for crates in submodules
1 parent 32d7af9 commit 76ad82e

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

.github/workflows/tests.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,18 @@ jobs:
3333
uses: Swatinem/rust-cache@v2
3434

3535
- name: Run Rust tests
36-
run: cargo test
36+
shell: bash
37+
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)
44+
# Build cargo test command with -p flags for each package
45+
# Format as `cargo test -p <package> -p <package> ...`
46+
echo "Running tests for packages: $packages"
47+
cargo test $(echo "$packages" | sed 's/\([^ ]*\)/-p \1/g')
3748
3849
# After Rust tests pass, run Python tests next
3950
- name: Set up Python ${{ matrix.python-version }}

0 commit comments

Comments
 (0)