Skip to content

Commit

Permalink
ci: find all tools now specifically looks for specified dep
Browse files Browse the repository at this point in the history
  • Loading branch information
nishaq503 committed Jul 25, 2024
1 parent 64911ae commit 0ef7938
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion .github/workflows/find-all-tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: Find All Tools

on:
workflow_call:
inputs:
dependency_name:
description: 'Name of the package which must be a dependency of the tools to return'
type: string
required: true
outputs:
matrix:
description: 'Matrix of tools to test'
Expand All @@ -25,8 +30,11 @@ jobs:
- name: Find tools
id: set-matrix
run: |
echo "Looking for tools that depend on ${{ inputs.dependency_name }}"
# List of directories to ignore
ignored_dirs="polus-python-template ftl-label .venv"
# List of tools that are broken for known reasons
broken_tools=""
Expand All @@ -35,7 +43,7 @@ jobs:
ignored_dirs=$(echo $ignored_dirs | xargs)
tool_dirs=""
# Get all directories in the current directory
# Get all sub-directories in the current directory
dirs=$(find $(pwd) -type d)
# Get all directories that have a "pyproject.toml" file
Expand All @@ -52,8 +60,16 @@ jobs:
done
# If the directory contains a "pyproject.toml" file, then add it to the list of tools
if [ -f "$dir/pyproject.toml" ]; then
# Check if the pyproject.toml file contains the dependency
dep_line=$(cat $dir/pyproject.toml | grep "${{ inputs.dependency_name }}")
# If the dependency is not found, then skip this tool
if [ -z "$dep_line" ]; then
continue
fi
# Since we found the dependency, add the tool to the list
tool_dirs="$tool_dirs $dir"
fi
done
# Remove leading and trailing spaces
tool_dirs=$(echo $tool_dirs | xargs)
Expand Down

0 comments on commit 0ef7938

Please sign in to comment.