Skip to content

Commit

Permalink
chore(ci): fix sonar test project detection
Browse files Browse the repository at this point in the history
  • Loading branch information
EuleMitKeule committed Apr 21, 2024
1 parent fc2244e commit d9f4cb2
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,16 @@ jobs:
name: Test Results
path: Tests

- name: Fix test project detection
run: |
find . -type f -name "*.csproj" ! -name "*Tests.csproj" -exec sh -c '
for file do
grep -q "<PropertyGroup>" "$file" &&
grep -Fq "<SonarQubeTestProject>false</SonarQubeTestProject>" "$file" ||
sed -i "/<PropertyGroup>/a \ <SonarQubeTestProject>false</SonarQubeTestProject>" "$file"
done
' sh {} +
- name: SonarCloud Scan
env:
FRAMEWORK_PATH: /opt/unity/Editor/Data/MonoBleedingEdge/bin
Expand All @@ -117,7 +127,7 @@ jobs:
/d:sonar.cs.nunit.reportsPaths=Tests/editmode-results.xml,Tests/playmode-results.xml \
/d:sonar.cs.opencover.reportsPaths=Tests/${{ env.PROJECT_NAME }}-opencov/EditMode/TestCoverageResults_0000.xml,Tests/${{ env.PROJECT_NAME }}-opencov/PlayMode/TestCoverageResults_0000.xml,Tests/${{ env.PROJECT_NAME }}-opencov/EditMode/TestCoverageResults_0001.xml,Tests/${{ env.PROJECT_NAME }}-opencov/PlayMode/TestCoverageResults_0001.xml
dotnet build ${{ env.PROJECT_DIR }}/${{ env.PROJECT_NAME }}.sln
./dotnet-sonarscanner end /d:sonar.login=${{ secrets.SONAR_TOKEN }}
./dotnet-sonarscanner end /d:sonar.token=${{ secrets.SONAR_TOKEN }}
version:
name: Version
Expand Down

0 comments on commit d9f4cb2

Please sign in to comment.