Skip to content

Restore source generator in docs and builds #9

Restore source generator in docs and builds

Restore source generator in docs and builds #9

Workflow file for this run

name: SonarCloud
on:
workflow_dispatch:
push:
paths-ignore:
- '**/*'
- '!.github/workflows/sonar-cloud.yml'
- '!src/**/*.cs'
branches:
- '*'
pull_request:
types: [opened, synchronize, reopened]
jobs:
build:
name: Build
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: 17
distribution: 'zulu'
- uses: actions/setup-node@v3
with:
node-version: 14
- name: Cache SonarCloud packages
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@v3
with:
path: .\src\.sonar\scanner
key: ${{ runner.os }}-sonar-scanner
restore-keys: ${{ runner.os }}-sonar-scanner
- name: Install SonarCloud scanner
shell: powershell
run: dotnet tool update dotnet-sonarscanner --tool-path .\src\.sonar\scanner
- name: Prepare
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
shell: powershell
working-directory: src
run: |
.\.sonar\scanner\dotnet-sonarscanner begin `
/k:"christianhelle_refitter" `
/o:"christianhelle-github" `
/d:sonar.token="${{ secrets.SONAR_TOKEN }}" `
/d:sonar.host.url="https://sonarcloud.io" `
/d:sonar.cs.vstest.reportsPaths=**/*.trx `
/d:sonar.cs.vscoveragexml.reportsPaths=**/*.coveragexml
- name: Restore
run: dotnet restore
working-directory: src
- name: Build
run: dotnet build -c Release
working-directory: src
- name: Run .NET Core Tests
working-directory: src
continue-on-error: true
run: dotnet test --collect "Code coverage"
- name: Convert Code Coverage
working-directory: src
continue-on-error: true
run: |
dotnet tool update dotnet-coverageconverter --tool-path .tools\coverage
.\.tools\coverage\dotnet-coverageconverter.exe --CoverageFilesFolder . --ProcessAllFiles
- name: Analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
shell: powershell
working-directory: src
run: |
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"