mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-20 21:33:15 -07:00
chore: 🚧 update sonar scan
This commit is contained in:
parent
fa458a816d
commit
909669a6e7
1 changed files with 25 additions and 19 deletions
44
.github/workflows/sonarscan.yml
vendored
44
.github/workflows/sonarscan.yml
vendored
|
@ -2,23 +2,24 @@ name: Sonar Scanner
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
sonarcloud:
|
||||||
name: Build
|
name: SonarCloud
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Set up JDK 11
|
|
||||||
uses: actions/setup-java@v1
|
|
||||||
with:
|
|
||||||
java-version: 1.11
|
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
|
# Shallow clones should be disabled for a better relevancy of analysis
|
||||||
- name: Cache SonarCloud packages
|
fetch-depth: 0
|
||||||
|
|
||||||
|
# Speed-up analysis by caching the scanner workspace
|
||||||
|
- name: Cache SonarCloud workspace
|
||||||
uses: actions/cache@v1
|
uses: actions/cache@v1
|
||||||
with:
|
with:
|
||||||
path: ~\sonar\cache
|
path: ~\.sonar\cache
|
||||||
key: ${{ runner.os }}-sonar
|
key: ${{ runner.os }}-sonar-cache
|
||||||
restore-keys: ${{ runner.os }}-sonar
|
restore-keys: ${{ runner.os }}-sonar-cache
|
||||||
|
|
||||||
|
# Speed-up analysis by caching the scanner installation
|
||||||
- name: Cache SonarCloud scanner
|
- name: Cache SonarCloud scanner
|
||||||
id: cache-sonar-scanner
|
id: cache-sonar-scanner
|
||||||
uses: actions/cache@v1
|
uses: actions/cache@v1
|
||||||
|
@ -26,19 +27,24 @@ jobs:
|
||||||
path: .\.sonar\scanner
|
path: .\.sonar\scanner
|
||||||
key: ${{ runner.os }}-sonar-scanner
|
key: ${{ runner.os }}-sonar-scanner
|
||||||
restore-keys: ${{ runner.os }}-sonar-scanner
|
restore-keys: ${{ runner.os }}-sonar-scanner
|
||||||
|
|
||||||
- name: Install SonarCloud scanner
|
- name: Install SonarCloud scanner
|
||||||
if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
|
if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
|
||||||
shell: powershell
|
shell: powershell
|
||||||
|
# The --version argument is optional. If it is omitted the latest version will be installed.
|
||||||
run: |
|
run: |
|
||||||
New-Item -Path .\.sonar\scanner -ItemType Directory
|
New-Item -Path .\.sonar\scanner -ItemType Directory
|
||||||
dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner
|
dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner --version 4.8.0
|
||||||
- name: Build and analyze
|
- name: Build
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
|
||||||
shell: powershell
|
shell: powershell
|
||||||
|
env:
|
||||||
|
# Needed to get some information about the pull request, if any
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
# The secret referenced in the command-line by SONAR_TOKEN should be generated
|
||||||
|
# from https://sonarcloud.io/account/security/
|
||||||
|
# The organization and project arguments (see /o and /k) are displayed
|
||||||
|
# on the project dashboard in SonarCloud.
|
||||||
run: |
|
run: |
|
||||||
.\.sonar\scanner\dotnet-sonarscanner begin /k:"Ombi-app_Ombi" /o:"ombi-app" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io"
|
.\.sonar\scanner\dotnet-sonarscanner begin /k:"SonarSource_sonarcloud-github-action-samples" /o:"sonarsource" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io"
|
||||||
cd src
|
dotnet build src/Ombi.sln
|
||||||
dotnet build -c NonUiBuild
|
|
||||||
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
|
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue