From f14d5eca3015b4f9265ae4fed8bf52101a54d44a Mon Sep 17 00:00:00 2001 From: Oscar Salazar Date: Wed, 19 Jun 2024 15:14:33 -0600 Subject: [PATCH 1/4] Validate python path for pytest is not empty as well --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e0198be..3d4bef5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -94,7 +94,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 From a80b981929609b8c4ac6d2c876580140a5681b87 Mon Sep 17 00:00:00 2001 From: Oscar Salazar Date: Wed, 19 Jun 2024 15:39:11 -0600 Subject: [PATCH 2/4] Update ci.yml --- .github/workflows/ci.yml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3d4bef5..09a6835 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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)) + { + var count = 0; + getPytestPaths(rootPath, x => + { + pytestPaths.add(x); + count++ + }) + + if (count > 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 From 7ad1accad33d68de08b1281d8709f8a8365db583 Mon Sep 17 00:00:00 2001 From: Oscar Salazar Date: Wed, 19 Jun 2024 15:40:24 -0600 Subject: [PATCH 3/4] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 09a6835..eac44b6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -78,7 +78,7 @@ jobs: const pytestArgs = new Set() for (const rootPath of paths) { - var count = 0; + let count = 0; getPytestPaths(rootPath, x => { pytestPaths.add(x); From df4d0d9930eb754af34533548b07af9ebd434608 Mon Sep 17 00:00:00 2001 From: Oscar Salazar Date: Wed, 19 Jun 2024 15:51:22 -0600 Subject: [PATCH 4/4] Update ci.yml --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eac44b6..1d0594f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -78,14 +78,14 @@ jobs: const pytestArgs = new Set() for (const rootPath of paths) { - let count = 0; + let subFoldersWithPythonFiles = 0; getPytestPaths(rootPath, x => { pytestPaths.add(x); - count++ + subFoldersWithPythonFiles++ }) - if (count > 0) + if (subFoldersWithPythonFiles > 0) { pytestArgs.add(rootPath) }