-
Notifications
You must be signed in to change notification settings - Fork 1
47 lines (47 loc) · 1.63 KB
/
sonar.yml
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: Build
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened]
env:
ASPNETCORE_ENVIRONMENT: Test
jobs:
build:
name: Build
runs-on: ubuntu-latest
services:
sqlserver:
image: mcr.microsoft.com/mssql/server:2019-latest
ports:
- 1434:1433
env:
ACCEPT_EULA: Y
SA_PASSWORD: SqlServer2019!
steps:
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install SonarCloud scanner
run: |
dotnet tool install --global dotnet-sonarscanner --version 5.14.0
- name: Install EF Core Tools
run: |
dotnet tool install --global dotnet-ef --version 8.0.0
- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
dotnet ef database update -p src/Orion.Infra.Data -s src/Orion.Api --verbose
dotnet sonarscanner begin /k:"vanderlan_Orion-Api" /o:"vanderlan-gomes" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.opencover.reportsPaths="opencover.xml"
dotnet build Orion.sln
dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:CoverletOutput=coverage /p:Exclude=[xunit.*]* Orion.sln
cp tests/Orion.Test/coverage.opencover.xml opencover.xml
dotnet sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"