Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,24 @@ jobs:
.filter(x => x.length > 0 && !x.startsWith('.')));

const pytestPaths = new Set()
const pytestArgs = new Set()
for (const rootPath of paths)
{
getPytestPaths(rootPath, x => pytestPaths.add(x))
{
let subFoldersWithPythonFiles = 0;
getPytestPaths(rootPath, x =>
{
pytestPaths.add(x);
subFoldersWithPythonFiles++
})

if (subFoldersWithPythonFiles > 0)
{
pytestArgs.add(rootPath)
}
}

core.setOutput('pytestPaths', [...pytestPaths].join(' '));
core.setOutput('pytestArgs', [...paths].join(' '));
core.setOutput('pytestArgs', [...pytestArgs].join(' '));

- name: Setup test environment
uses: conda-incubator/setup-miniconda@v2
Expand All @@ -94,7 +105,8 @@ jobs:
- name: Run tests
run: |
args=${{ steps.tests_to_run.outputs.pytestArgs }}
if [ -z "${args}" ]; then
pythonpath=${{ steps.tests_to_run.outputs.pytestPaths }}
if [ -z "${args}" ] || [ -z "${pythonpath}" ]; then
echo “Nothing to test”
else
pytest $args
Expand Down