Skip to content

Commit e948c23

Browse files
metsmamrts
authored andcommitted
Disable SonarCloud on forks
WE2-782 Signed-off-by: Raul Metsma <[email protected]>
1 parent 2fa166e commit e948c23

File tree

4 files changed

+30
-31
lines changed

4 files changed

+30
-31
lines changed

.github/workflows/coverity-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ jobs:
2121
- uses: actions/checkout@v3
2222

2323
- name: Setup dotnet
24-
uses: actions/setup-dotnet@v1
24+
uses: actions/setup-dotnet@v3
2525
with:
2626
dotnet-version: 6.0.x # SDK Version to use.
2727

2828
- name: Cache Nuget packages
29-
uses: actions/cache@v2
29+
uses: actions/cache@v3
3030
with:
3131
path: ~/.nuget/packages
3232
# Look to see if there is a cache hit for the corresponding requirements file

.github/workflows/dotnet-build-linux.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,24 @@ jobs:
77
runs-on: ubuntu-latest
88

99
steps:
10-
- uses: actions/checkout@v2
11-
10+
- uses: actions/checkout@v3
11+
1212
- name: Setup dotnet
13-
uses: actions/setup-dotnet@v1
13+
uses: actions/setup-dotnet@v3
1414
with:
1515
dotnet-version: 6.0.x # SDK Version to use.
16-
17-
- name: Cache Nuget packages
18-
uses: actions/cache@v2
16+
17+
- name: Cache Nuget packages
18+
uses: actions/cache@v3
1919
with:
2020
path: ~/.nuget/packages
2121
# Look to see if there is a cache hit for the corresponding requirements file
2222
key: ${{ runner.os }}-nuget-${{ secrets.CACHE_VERSION }}-${{ hashFiles('**/packages.lock.json') }}
2323
restore-keys: ${{ runner.os }}-nuget-${{ secrets.CACHE_VERSION }}
24-
24+
2525
- name: Install dependencies
2626
run: dotnet restore src/WebEid.Security.sln
27-
27+
2828
- name: Build
2929
run: dotnet build --configuration Release --no-restore src/WebEid.Security.sln
3030

.github/workflows/dotnet-build-windows.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,32 +7,32 @@ jobs:
77
runs-on: windows-latest
88

99
steps:
10-
- uses: actions/checkout@v2
11-
10+
- uses: actions/checkout@v3
11+
1212
- name: Setup dotnet
13-
uses: actions/setup-dotnet@v1
13+
uses: actions/setup-dotnet@v3
1414
with:
1515
dotnet-version: 6.0.x # SDK Version to use.
16-
16+
1717
- name: Setup MSBuild
18-
uses: microsoft/setup-msbuild@v1.0.2
18+
uses: microsoft/setup-msbuild@v1.1
1919
with:
2020
vs-version: 17.1 # Visual Studio Version to use.
2121

2222
- name: Setup VSTest
23-
uses: darenm/Setup-VSTest@v1
23+
uses: darenm/Setup-VSTest@v1.2
2424

25-
- name: Cache Nuget packages
26-
uses: actions/cache@v2
25+
- name: Cache Nuget packages
26+
uses: actions/cache@v3
2727
with:
2828
path: ~/.nuget/packages
2929
# Look to see if there is a cache hit for the corresponding requirements file
3030
key: ${{ runner.os }}-nuget-${{ secrets.CACHE_VERSION }}-${{ hashFiles('**/packages.lock.json') }}
3131
restore-keys: ${{ runner.os }}-nuget-${{ secrets.CACHE_VERSION }}
32-
32+
3333
- name: Install dependencies
3434
run: dotnet restore src/WebEid.Security.sln
35-
35+
3636
- name: Build
3737
run: msbuild src/WebEid.Security.sln /t:Build /p:Configuration=Release
3838

.github/workflows/sonarcloud-analysis.yml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,27 @@ on: [push, pull_request]
55
jobs:
66
analyze:
77
name: Analyze
8+
if: github.repository == 'web-eid/web-eid-authtoken-validation-dotnet'
89
runs-on: windows-latest
910

1011
steps:
11-
- uses: actions/checkout@v2
12+
- uses: actions/checkout@v3
1213
with:
1314
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
14-
15+
1516
- name: Setup dotnet
16-
uses: actions/setup-dotnet@v1
17+
uses: actions/setup-dotnet@v3
1718
with:
1819
dotnet-version: 6.0.x # SDK Version to use.
1920

2021
- name: Set up JDK 11
21-
uses: actions/setup-java@v1
22+
uses: actions/setup-java@v3
2223
with:
24+
distribution: zulu
2325
java-version: 11
2426

25-
- name: Cache Nuget packages
26-
uses: actions/cache@v2
27+
- name: Cache Nuget packages
28+
uses: actions/cache@v3
2729
with:
2830
path: ~/.nuget/packages
2931
# Look to see if there is a cache hit for the corresponding requirements file
@@ -34,15 +36,15 @@ jobs:
3436
run: dotnet restore src/WebEid.Security.sln
3537

3638
- name: Cache SonarCloud packages
37-
uses: actions/cache@v2
39+
uses: actions/cache@v3
3840
with:
3941
path: ~/.sonar/cache
4042
key: ${{ runner.os }}-sonar
4143
restore-keys: ${{ runner.os }}-sonar
4244

4345
- name: Cache SonarCloud scanner
4446
id: cache-sonar-scanner
45-
uses: actions/cache@v2
47+
uses: actions/cache@v3
4648
with:
4749
path: .\.sonar\scanner
4850
key: ${{ runner.os }}-sonar-scanner
@@ -62,9 +64,6 @@ jobs:
6264
shell: powershell
6365
run: |
6466
.\.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"
65-
6667
dotnet build --configuration Release --no-restore src/WebEid.Security.sln
67-
6868
dotnet test src/WebEid.Security.sln --logger trx --collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover --results-directory "TestResults"
69-
7069
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"

0 commit comments

Comments
 (0)