Skip to content

Commit b38569e

Browse files
use cargo metadata to find cdylib crates
1 parent c4e6ee5 commit b38569e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

.github/workflows/test-with-openzeppelin-stellar-contracts.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- id: dirs
2626
run: |
2727
# Find Cargo.toml files that build to crate-type cdylib.
28-
dirs=$(find . -name 'Cargo.toml' -mindepth 2 | xargs -I {} sh -c 'if grep -q "cdylib" "{}"; then dirname "{}"; fi' | sed 's|^\./||' | jq -Rnc '[inputs | "\(.)"]')
28+
dirs=$(cargo metadata --format-version 1 | jq -r '.workspace_members[] as $id | .packages[] | select(.id == $id) | select(any(.targets[]; any(.crate_types[]; . == "cdylib"))) | .manifest_path | sub("/Cargo.toml$"; "") | sub("^\\./"; "")' | jq -Rnc '[inputs | "\(.)"]')
2929
echo "dirs=$dirs" >> $GITHUB_OUTPUT
3030
outputs:
3131
dirs: ${{ steps.dirs.outputs.dirs }}

0 commit comments

Comments
 (0)