Skip to content

v1.2.4 release

v1.2.4 release #116

name: SonarCloud
on:
push:
branches: [main, develop]
paths-ignore:
# Any update here needs to be done for
# - `pull_request` see below
- '*.md'
- '.github/ISSUE_TEMPLATE/**'
- '.github/pull_request_template.md'
- '.github/stale.yml'
- 'LICENSE'
pull_request:
branches: [main, develop]
types: [opened, synchronize, reopened]
paths-ignore:
# Any update here needs to be done for
# - `push`see before
- '*.md'
- '.github/ISSUE_TEMPLATE/**'
- '.github/pull_request_template.md'
- '.github/stale.yml'
- 'LICENSE'
env:
sonarSecret: ${{ secrets.SONAR_TOKEN }}
jobs:
analyze:
name: SonarCloud
runs-on: windows-latest
steps:
- name: Set up JDK 11
uses: actions/setup-java@v1
if: ${{ env.sonarSecret != 0 }} # Only run scan if secret use is allowed - requires secrets to run successfully
with:
java-version: 1.11
- uses: actions/checkout@v2
if: ${{ env.sonarSecret != 0 }} # Only run scan if secret use is allowed - requires secrets to run successfully
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Cache SonarCloud packages
uses: actions/[email protected]
if: ${{ env.sonarSecret != 0 }} # Only run scan if secret use is allowed - requires secrets to run successfully
with:
path: ~\sonar\cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache SonarCloud scanner
id: cache-sonar-scanner
uses: actions/[email protected]
if: ${{ env.sonarSecret != 0 }} # Only run scan if secret use is allowed - requires secrets to run successfully
with:
path: .\.sonar\scanner
key: ${{ runner.os }}-sonar-scanner
restore-keys: ${{ runner.os }}-sonar-scanner
- name: Install SonarCloud scanner
if: ${{ steps.cache-sonar-scanner.outputs.cache-hit != 'true' && env.sonarSecret != 0 }}
shell: powershell
run: |
New-Item -Path .\.sonar\scanner -ItemType Directory
dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner
- name: Build and analyze
if: ${{ env.sonarSecret != 0 }} # Only run scan if secret use is allowed - requires secrets to run successfully
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:"ConsumerDataRight_mock-data-recipient" /o:"consumerdataright" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io"
dotnet build .\source\DataRecipient.sln
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"