mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-24 05:28:05 +00:00
improved github actions workflow
This commit is contained in:
@@ -12,7 +12,7 @@ permissions:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
Code_Coverage:
|
Code_Coverage:
|
||||||
runs-on: ubuntu-latest
|
runs-on: windows-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -24,6 +24,20 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
dotnet-version: '8.x'
|
dotnet-version: '8.x'
|
||||||
|
|
||||||
|
- name: Set up JDK 17
|
||||||
|
uses: actions/setup-java@v4
|
||||||
|
with:
|
||||||
|
java-version: 17
|
||||||
|
distribution: 'zulu'
|
||||||
|
|
||||||
|
- name: Cache SonarCloud scanner
|
||||||
|
id: cache-sonar-scanner
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: .\.sonar\scanner
|
||||||
|
key: ${{ runner.os }}-sonar-scanner
|
||||||
|
restore-keys: ${{ runner.os }}-sonar-scanner
|
||||||
|
|
||||||
- name: Install dotnet tools
|
- name: Install dotnet tools
|
||||||
run: |
|
run: |
|
||||||
dotnet tool install JetBrains.dotCover.GlobalTool --global
|
dotnet tool install JetBrains.dotCover.GlobalTool --global
|
||||||
@@ -33,6 +47,26 @@ jobs:
|
|||||||
dotnet tool install --global dotnet-reportgenerator-globaltool
|
dotnet tool install --global dotnet-reportgenerator-globaltool
|
||||||
dotnet restore
|
dotnet restore
|
||||||
|
|
||||||
|
- name: Begin SonarCloud Analysis
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||||
|
shell: powershell
|
||||||
|
run: |
|
||||||
|
dotnet sonarscanner begin /k:"mihakralj_QuanTAlib" /o:"mihakralj-quantalib" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" `
|
||||||
|
/d:sonar.solution.file="QuanTAlib.sln" `
|
||||||
|
/d:sonar.cs.opencover.reportsPaths="**/*cover*.xml" `
|
||||||
|
/d:sonar.cs.dotcover.reportsPaths="**/dotcover.xml" `
|
||||||
|
/d:sonar.coverage.exclusions="**Tests.cs,**/*.md,**/*.html,**/*.css,**/docs/**/*,**/archive/**/*,**/notebooks/**/*,**/obj/**/*,**/bin/**/*" `
|
||||||
|
/d:sonar.exclusions="**/TestResults/**/*,**/bin/**/*,**/obj/**/*,**/*.html,**/coverage/**/*,**/CoverageReport/**/*,**/*.md,**/*.css,**/docs/**/*,**/archive/**/*,**/notebooks/**/*" `
|
||||||
|
/d:sonar.test.exclusions="**Tests.cs,**/obj/**/*,**/bin/**/*" `
|
||||||
|
/d:sonar.cpd.exclusions="**Tests.cs" `
|
||||||
|
/d:sonar.cs.roslyn.ignoreIssues="false" `
|
||||||
|
/d:sonar.issue.ignore.multicriteria="e1" `
|
||||||
|
/d:sonar.issue.ignore.multicriteria.e1.ruleKey="csharpsquid:S1944,csharpsquid:S2053,csharpsquid:S2222,csharpsquid:S2259,csharpsquid:S2583,csharpsquid:S2589,csharpsquid:S3329,csharpsquid:S3655,csharpsquid:S3900,csharpsquid:S3949,csharpsquid:S3966,csharpsquid:S4158,csharpsquid:S4347,csharpsquid:S5773,csharpsquid:S6781" `
|
||||||
|
/d:sonar.issue.ignore.multicriteria.e1.resourceKey="**/*.cs" `
|
||||||
|
/d:sonar.verbose="true"
|
||||||
|
|
||||||
- name: Build Projects
|
- name: Build Projects
|
||||||
run: |
|
run: |
|
||||||
dotnet build --no-restore --configuration Debug
|
dotnet build --no-restore --configuration Debug
|
||||||
@@ -54,6 +88,13 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
reportgenerator -reports:*cover*.xml -targetdir:.
|
reportgenerator -reports:*cover*.xml -targetdir:.
|
||||||
|
|
||||||
|
- name: End SonarCloud Analysis
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||||
|
shell: powershell
|
||||||
|
run: dotnet sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
|
||||||
|
|
||||||
- name: Upload Coverage to Codacy
|
- name: Upload Coverage to Codacy
|
||||||
uses: codacy/codacy-coverage-reporter-action@v1
|
uses: codacy/codacy-coverage-reporter-action@v1
|
||||||
with:
|
with:
|
||||||
@@ -66,23 +107,6 @@ jobs:
|
|||||||
files: 'cover*'
|
files: 'cover*'
|
||||||
verbose: true
|
verbose: true
|
||||||
|
|
||||||
- name: SonarCloud Scan
|
|
||||||
uses: SonarSource/sonarcloud-github-action@master
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
|
||||||
with:
|
|
||||||
args: >
|
|
||||||
-Dsonar.projectKey=mihakralj_QuanTAlib
|
|
||||||
-Dsonar.organization=mihakralj-quantalib
|
|
||||||
-Dsonar.sources=.
|
|
||||||
-Dsonar.cs.opencover.reportsPaths=**/*cover*.xml
|
|
||||||
-Dsonar.cs.dotcover.reportsPaths=**/dotcover.xml
|
|
||||||
-Dsonar.coverage.exclusions=**Tests.cs,**/*.md,**/*.html,**/*.css,**/docs/**/*,**/archive/**/*,**/notebooks/**/*
|
|
||||||
-Dsonar.exclusions=**/TestResults/**/*,**/bin/**/*,**/obj/**/*,**/*.html,**/coverage/**/*,**/CoverageReport/**/*,**/*.md,**/*.css,**/docs/**/*,**/archive/**/*,**/notebooks/**/*
|
|
||||||
-Dsonar.cpd.exclusions=**Tests.cs
|
|
||||||
-Dsonar.test.exclusions=**Tests.cs
|
|
||||||
|
|
||||||
CodeQL:
|
CodeQL:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
|||||||
Reference in New Issue
Block a user