Skip to content

Commit d9bcd74

Browse files
Merge pull request #117 from trakx/dev
Dev ➡️ Master v10.2.1
2 parents 09e053d + 7c8ae6d commit d9bcd74

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

test-dotnet/action.yml

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,25 @@ runs:
5656
aws-secret-access-key: ${{inputs.awsAccessKeySecret}}
5757
aws-region: ${{inputs.awsRegion}}
5858

59-
# GitHubActionsTestLogger nuget package should be installed in the test project
60-
# coverlet.msbuild nuget package should be installed to generate coverage report
59+
# GitHubActionsTestLogger nuget package should be installed in the test project.
60+
# coverlet.msbuild nuget package should be installed to generate coverage report.
61+
# The loop is necessary to prevent the following error:
62+
# "Could not find a test logger with AssemblyQualifiedName, URI or FriendlyName 'GitHubActions'."
6163
- name: .NET Test
6264
shell: bash
63-
run: dotnet test
64-
--no-restore
65-
--configuration Debug
66-
--logger GitHubActions
67-
--collect "XPlat Code Coverage"
68-
--results-directory "TestResults/"
65+
run: |
66+
for f in $(find . -name "*.Tests.csproj");
67+
do
68+
echo "testing project $f" && \
69+
csprojName=${f##*/} && \
70+
projectName="${csprojName/.csproj/}" && \
71+
dotnet test $f \
72+
--no-restore \
73+
--configuration Debug \
74+
--logger GitHubActions \
75+
--collect "XPlat Code Coverage" \
76+
--results-directory "TestResults/$projectName"
77+
done
6978
7079
# .NET Test puts the coverage file under a random directory [Guid]/coverage.cobertura.xml
7180
# That's why we locate the coverage file first and pass it to the upload script

0 commit comments

Comments
 (0)