-
Notifications
You must be signed in to change notification settings - Fork 4
65 lines (52 loc) · 1.77 KB
/
analyze.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: 'Analyze'
on:
schedule:
- cron: '0 0 * * 5'
workflow_dispatch:
env:
DOTNET_VERSION: '8.0.x' # set this to the dotnet version to use
jobs:
analyze:
name: 'Analyze'
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@v3
- name: 'Setup DotNet ${{ env.DOTNET_VERSION }} Environment'
uses: actions/setup-dotnet@v2
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: 'Install dotnet-sonarscanner'
run: |
dotnet tool install --global dotnet-sonarscanner
- name: 'Install dotnet-coverage'
run: |
dotnet tool install --global dotnet-coverage
- name: 'Install DeepSource CLI'
run: |
curl https://deepsource.io/cli | sh
- name: 'SonarCloud Begin'
run: |
dotnet sonarscanner begin \
/k:"lAnubisl_LostFilmTorrentsFeed" \
/o:"lanubisl" \
/d:sonar.login="${{ secrets.SONAR_TOKEN }}" \
/d:sonar.host.url="https://sonarcloud.io" \
/d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml
- name: 'CodeQL Begin'
uses: github/codeql-action/init@v2
with:
languages: 'csharp'
- name: 'Restore Solution Dependencies'
run: |
dotnet restore
- name: 'Build Solution'
run: |
dotnet build --configuration Release --no-restore
- name: 'Run Unit Tests'
run: |
dotnet-coverage collect 'dotnet test --configuration Release --no-build --no-restore' -f xml -o 'coverage.xml'
- name: 'CodeQL End'
uses: github/codeql-action/analyze@v2
- name: 'SonarCloud End'
run: dotnet sonarscanner end /d:sonar.login=${{ secrets.SONAR_TOKEN }}