-
Notifications
You must be signed in to change notification settings - Fork 2
33 lines (28 loc) · 973 Bytes
/
Copy pathsonarPR.yml
File metadata and controls
33 lines (28 loc) · 973 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
name: Run SonarCloud on code
on:
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.101
- name: Restore
run: dotnet restore
- name: Install sonarscanner
run: dotnet tool install --global dotnet-sonarscanner
- name: Set ref id
run: echo ::set-env name=REF_ID::$(echo ${{ github.ref }} | grep -oP '([0-9]*)')
- name: Start Scanner
run: dotnet sonarscanner begin /k:jlndk_devoops /d:sonar.host.url=https://sonarcloud.io /o:jlndk /d:sonar.login=${{ secrets.SONAR_KEY }} /d:sonar.pullrequest.key=${{ env.REF_ID }}
- name: Dotnet build
run: dotnet build --configuration Release
- name: dotnet test
run: dotnet test
- name: Upload sonarcloud report
run: dotnet sonarscanner end /d:sonar.login=${{ secrets.SONAR_KEY }}