Skip to content

Introduce code fix

Introduce code fix #53

Workflow file for this run

name: CI
on:
pull_request:
branches: [ main ]
push:
branches: [ main ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-and-test:
runs-on: windows-latest
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
steps:
- uses: actions/[email protected]
with:
fetch-depth: 0
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v2
- name: Install .NET tools
run: |
dotnet tool install --global dotnet-sonarscanner
dotnet tool install --global dotnet-coverage
echo "$HOME/.dotnet/tools" >> $GITHUB_PATH
- name: Begin SonarCloud analysis
run: dotnet sonarscanner begin /k:"jonathanalgar_CustomCode-Analyzer" /o:"jonathanalgar" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml
- name: Restore dependencies
run: dotnet restore
- name: Build and test Analyzer
run: |
dotnet build src/CustomCode-Analyzer/CustomCode-Analyzer.csproj --configuration Release
dotnet build tests/CustomCode-Analyzer.Tests/CustomCode-Analyzer.Tests.csproj --configuration Release
dotnet-coverage collect "dotnet test tests/CustomCode-Analyzer.Tests/CustomCode-Analyzer.Tests.csproj --no-build --configuration Release --verbosity normal" -f xml -o "coverage.xml"
- name: Build VSIX
run: msbuild src\CustomCode-Analyzer.Vsix\CustomCode-Analyzer.Vsix.csproj /p:Configuration=Release /p:DeployExtension=false /p:ZipPackageCompressionLevel=Normal /m:4
- name: End SonarCloud analysis
run: dotnet sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
- name: Upload build artifacts
uses: actions/[email protected]
with:
name: build-artifacts
path: |
src/CustomCode-Analyzer.Vsix/bin/Release/CustomCode_Analyzer.vsix
src/CustomCode-Analyzer/bin/Release/*.nupkg