Skip to content

sonar.login is deprecated - switching to sonar.token #18

sonar.login is deprecated - switching to sonar.token

sonar.login is deprecated - switching to sonar.token #18

Workflow file for this run

name: "Pre-Integration"
on:
pull_request:
types:
- opened
- synchronize
- reopened
jobs:
dotnet-test:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: 🛒 Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: ⚙️ Setup dotnet 6.0.x
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.x'
- name: 🧹 Clean
run: dotnet clean -c Release && dotnet nuget locals all --clear
- name: 🔁 Restore packages
run: dotnet restore
- name: 🧪 Run unit tests in release mode
run: dotnet test -c Release --no-restore
sonar-cloud:
runs-on: windows-latest
steps:
- name: 🛒 Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
token: ${{ secrets.PAT_WORKFLOWS }}
- name: ⚙️ Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'zulu'
- name: 🧹 Clean
run: dotnet clean -c Release && dotnet nuget locals all --clear
- name: 🔁 Restore packages
run: dotnet restore
- name: 🌩️ SonarCloud install scanner
run: dotnet tool install --global dotnet-sonarscanner
- name: 🌩️ SonarCloud Prepare
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
shell: pwsh
run: |
dotnet-sonarscanner begin `
/k:"atc-azure-messaging" `
/o:"atc-net" `
/d:sonar.token="${{ secrets.SONAR_TOKEN }}" `
/d:sonar.host.url="https://sonarcloud.io" `
/d:sonar.cs.vscoveragexml.reportsPaths=**/*.coveragexml
- name: 🛠️ Build
run: dotnet build -c Release --no-restore /p:UseSourceLink=true
- name: 🧪 Run unit tests
run: dotnet test -c Release --no-build --collect "Code coverage"
- name: ⚙️ Setup dotnet 6.0.x
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.x'
- name: Convert Code Coverage
continue-on-error: true
run: |
dotnet tool update dotnet-coverageconverter --global
dotnet-coverageconverter --CoverageFilesFolder . --ProcessAllFiles
- name: 🌩️ SonarCloud analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
shell: pwsh
run: |
dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"