From c09f80a31521d8a1b60ce7d4bc93f2273101a97a Mon Sep 17 00:00:00 2001 From: Mihkel Kivisild Date: Tue, 5 Nov 2024 17:17:07 +0200 Subject: [PATCH] Updated GitHub Actions to latest versions & allowing SonarCloud analysis to run on external pull requests WE2-963 WE2-1011 Signed-off-by: Mihkel Kivisild --- .github/workflows/coverity-analysis.yml | 2 +- .github/workflows/dotnet-build-windows.yml | 6 +++--- .github/workflows/sonarcloud-analysis.yml | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/coverity-analysis.yml b/.github/workflows/coverity-analysis.yml index eeb4213..923a554 100644 --- a/.github/workflows/coverity-analysis.yml +++ b/.github/workflows/coverity-analysis.yml @@ -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 diff --git a/.github/workflows/dotnet-build-windows.yml b/.github/workflows/dotnet-build-windows.yml index 3fb7f48..a7533d9 100644 --- a/.github/workflows/dotnet-build-windows.yml +++ b/.github/workflows/dotnet-build-windows.yml @@ -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 diff --git a/.github/workflows/sonarcloud-analysis.yml b/.github/workflows/sonarcloud-analysis.yml index d4d12d3..5e6c341 100644 --- a/.github/workflows/sonarcloud-analysis.yml +++ b/.github/workflows/sonarcloud-analysis.yml @@ -1,6 +1,6 @@ name: SonarCloud code analysis -on: [push] +on: [push, pull_request, pull_request_target] jobs: analyze: @@ -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 @@ -63,7 +63,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 }}"