-
Notifications
You must be signed in to change notification settings - Fork 5
44 lines (32 loc) · 1.05 KB
/
dotnet-pipeline.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
name: .NET
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
services:
redis:
image: redis
ports:
- 6379:6379
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: 6.0.x
- name: Restore dependencies
run: dotnet restore *.sln
- name: Instal sonarscanner
run: dotnet tool install --global dotnet-sonarscanner
- name: Sonarscanner begin
run: dotnet sonarscanner begin /o:"${{ secrets.SONAR_ORGANIZATION }}" /k:"${{ secrets.SONAR_PROJECT_KEY }}" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io"
- name: Build
run: dotnet build *.sln --no-restore --configuration Release
- name: Run tests
run: dotnet test */TestProject.csproj --configuration Release
- name: Sonarscanner end
run: dotnet sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"