Skip to content

Commit fddf901

Browse files
Update test.yml
updated incase there are not tests
1 parent 961c7aa commit fddf901

1 file changed

Lines changed: 17 additions & 4 deletions

File tree

.github/workflows/test.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,23 @@ jobs:
5454

5555
- name: Run Tests
5656
run: |
57-
dotnet test --no-build --configuration ${{ env.BUILD_CONFIGURATION }} \
58-
--framework net9.0 \
59-
--logger:trx --results-directory:./TestResults \
60-
${{ env.SOLUTION_NAME }}
57+
mkdir -p TestResults
58+
found=false
59+
for proj in $(find . -name "*.Tests.csproj"); do
60+
found=true
61+
echo "Running tests for $proj"
62+
dotnet test "$proj" \
63+
--no-build \
64+
--configuration ${{ env.BUILD_CONFIGURATION }} \
65+
--framework net9.0 \
66+
--logger "trx;LogFileName=$(basename $proj).trx" \
67+
--results-directory ./TestResults
68+
done
69+
70+
if [ "$found" = false ]; then
71+
echo "⚠️ No test projects (*.Tests.csproj) were found in this repository."
72+
exit 1
73+
fi
6174
6275
- name: Upload Test Results
6376
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)