Skip to content

Commit

Permalink
Update ci.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-osalazarlizano committed Jun 24, 2024
1 parent 09fc9c1 commit 50269a1
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ jobs:
const { MODIFIED_APPS } = process.env;
const fs = require('fs');
const path = require('path');
var has_tests = false;
function getPytestPaths(dir, callback)
{
Expand All @@ -59,13 +60,18 @@ jobs:
if (extension == '.py')
{
if (file.name.startsWith('test'))
{
has_tests = true
}
callback(dir);
}
}
}
}
const paths = MODIFIED_APPS.split(",")
const paths = MODIFIED_APPS.length > 0 ? MODIFIED_APPS.split(",") : []
const pytestPaths = new Set()
const pytestArgs = new Set()
Expand All @@ -84,8 +90,8 @@ jobs:
}
}
core.setOutput('pytestPaths', [...pytestPaths].join(' '));
core.setOutput('pytestArgs', [...pytestArgs].join(' '));
core.setOutput('pytestPaths', has_tests ? [...pytestPaths].join(' ') : "");
core.setOutput('pytestArgs', has_tests ? [...pytestArgs].join(' ') : "");
- name: Setup test environment
uses: conda-incubator/setup-miniconda@v2
Expand All @@ -98,8 +104,9 @@ jobs:
python -m pip install pytest
- name: Run tests
run: |
args=${{ steps.tests_to_run.outputs.pytestArgs }}
pythonpath=${{ steps.tests_to_run.outputs.pytestPaths }}
args="${{ steps.tests_to_run.outputs.pytestArgs }}"
pythonpath="${{ steps.tests_to_run.outputs.pytestPaths }}"
if [ -z "${args}" ] || [ -z "${pythonpath}" ]; then
echo “Nothing to test”
else
Expand Down

0 comments on commit 50269a1

Please sign in to comment.