Skip to content

Commit 5e31d14

Browse files
authored
Merge pull request #17 from django-components/jo-feat-safe-eval
2 parents b6cedfb + efe8e8c commit 5e31d14

File tree

23 files changed

+9563
-96
lines changed

23 files changed

+9563
-96
lines changed

.github/workflows/tests.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ jobs:
1818

1919
steps:
2020
- uses: actions/checkout@v5
21+
with:
22+
# Initialize Ruff submodule
23+
submodules: recursive
2124

2225
# First check Rust tests
2326
- name: Install Rust toolchain
@@ -30,7 +33,20 @@ jobs:
3033
uses: Swatinem/rust-cache@v2
3134

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

.gitmodules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[submodule "crates/djc-safe-eval/submodules/ruff"]
2+
path = crates/djc-safe-eval/submodules/ruff
3+
url = https://github.com/astral-sh/ruff.git
4+
# tag = 0.14.0

0 commit comments

Comments
 (0)