Skip to content

Commit

Permalink
Updated GitHub Actions to latest versions & allowing SonarCloud analy…
Browse files Browse the repository at this point in the history
…sis to run on external pull requests

WE2-963
WE2-1011

Signed-off-by: Mihkel Kivisild <[email protected]>
  • Loading branch information
Mihkel Kivisild committed Nov 12, 2024
1 parent bbd6281 commit 2d55df5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/coverity-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.x # SDK Version to use.
dotnet-version: 8.0.x # SDK Version to use.

- name: Cache Nuget packages
uses: actions/cache@v4
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/dotnet-build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ jobs:
dotnet-version: 8.0.x # SDK Version to use.

- name: Setup MSBuild
uses: microsoft/setup-msbuild@v1.1
uses: microsoft/setup-msbuild@v2
with:
vs-version: 17.1 # Visual Studio Version to use.
vs-version: 17.11 # Visual Studio Version to use.

- name: Setup VSTest
uses: darenm/Setup-VSTest@v1.2
uses: darenm/Setup-VSTest@v1.3

- name: Cache Nuget packages
uses: actions/cache@v4
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/sonarcloud-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: SonarCloud code analysis

on: [push]
on: [push, pull_request, pull_request_target]

jobs:
analyze:
Expand All @@ -16,7 +16,7 @@ jobs:
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.x # SDK Version to use.
dotnet-version: 8.0.x # SDK Version to use.

- name: Set up JDK 21
uses: actions/setup-java@v4
Expand Down Expand Up @@ -51,7 +51,6 @@ jobs:
restore-keys: ${{ runner.os }}-sonar-scanner

- name: Install SonarCloud scanner
if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
shell: powershell
run: |
New-Item -Path .\.sonar\scanner -ItemType Directory
Expand All @@ -63,7 +62,7 @@ jobs:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
shell: powershell
run: |
.\.sonar\scanner\dotnet-sonarscanner begin /k:"web-eid_web-eid-authtoken-validation-dotnet" /o:"web-eid" /d:sonar.cs.opencover.reportsPaths="**/TestResults/**/coverage.opencover.xml" -d:sonar.cs.vstest.reportsPaths="**/TestResults/*.trx" /d:sonar.verbose=true /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io"
.\.sonar\scanner\dotnet-sonarscanner begin /k:"web-eid_web-eid-authtoken-validation-dotnet" /o:"web-eid" /d:sonar.cs.opencover.reportsPaths="**/TestResults/**/coverage.opencover.xml" -d:sonar.cs.vstest.reportsPaths="**/TestResults/*.trx" /d:sonar.verbose=true /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io"
dotnet build --configuration Release --no-restore src/WebEid.Security.sln
dotnet test src/WebEid.Security.sln --logger trx --collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover --results-directory "TestResults"
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"

0 comments on commit 2d55df5

Please sign in to comment.