Skip to content

Commit

Permalink
Update Sonar.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
juanvaler-gnoss authored Jan 18, 2024
1 parent 8290e1b commit 2ba1051
Showing 1 changed file with 20 additions and 19 deletions.
39 changes: 20 additions & 19 deletions .github/workflows/Sonar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,23 @@ jobs:
name: Build
runs-on: windows-latest
steps:
- name: Set up JDK 11
uses: actions/setup-java@v1
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 1.11
- uses: actions/checkout@v2
java-version: 17
distribution: 'zulu' # Alternative distribution options are available.
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: check out commons
uses: actions/checkout@v2
with:
repository: equipognoss/Gnoss.Commons.OpenCORE
path: ./Gnoss.Commons
ref: main
- name: change folder
run: |
cd ..
mv Gnoss.BackgroundTask.Replication.OpenCORE/Gnoss.Commons Gnoss.Commons
cd Gnoss.BackgroundTask.Replication.OpenCORE
- name: Cache SonarCloud packages
uses: actions/cache@v1
uses: actions/cache@v3
with:
path: ~\sonar\cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache SonarCloud scanner
id: cache-sonar-scanner
uses: actions/cache@v1
uses: actions/cache@v3
with:
path: .\.sonar\scanner
key: ${{ runner.os }}-sonar-scanner
Expand All @@ -47,12 +37,23 @@ jobs:
run: |
New-Item -Path .\.sonar\scanner -ItemType Directory
dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner
- name: check out commons
uses: actions/checkout@v2
with:
repository: equipognoss/Gnoss.Commons.OpenCORE
path: ./Gnoss.Commons
ref: main
- name: change folder
run: |
cd ..
mv Gnoss.BackgroundTask.Replication.OpenCORE/Gnoss.Commons Gnoss.Commons
cd Gnoss.BackgroundTask.Replication.OpenCORE
- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
shell: powershell
run: |
.\.sonar\scanner\dotnet-sonarscanner begin /k:"equipognoss_Gnoss.BackgroundTask.Replication.OpenCORE" /o:"equipognoss" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io"
.\.sonar\scanner\dotnet-sonarscanner begin /k:"equipognoss_Gnoss.BackgroundTask.Replication.OpenCORE" /o:"equipognoss" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io"
dotnet build
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"

0 comments on commit 2ba1051

Please sign in to comment.