Skip to content

Fix indention

Fix indention #24

Workflow file for this run

name: "CI"
on:
push:
branches: [ develop, main ]
jobs:
build:
runs-on: windows-latest
env:
Solution: "src/CleanMyPosts.sln"
UnitTest_Project: "src/UnitTests/UnitTests.csproj"
IntegrationTest_Project: "src/IntegrationTests/IntegrationTests.csproj"
FORCE_COLOR: "true"
DOTNET_LOGGING__CONSOLE__COLORBEHAVIOR: Enabled
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.x
- name: Install .NET Tools (local)
run: |
dotnet new tool-manifest
dotnet tool install dotnet-reportgenerator-globaltool
dotnet tool install dotnet-sonarscanner
- name: Restore
run: dotnet restore "${{ env.Solution }}"
- name: Build and Test with SonarQube
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
dotnet tool run dotnet-sonarscanner begin `
/k:"thorstenalpers_CleanMyPosts" `
/o:"thorstenalpers" `
/d:sonar.token="${{ secrets.SONAR_TOKEN }}" `
/d:sonar.host.url="https://sonarcloud.io" `
/d:sonar.sources="src" `
/d:sonar.tests="src/UnitTests;src/IntegrationTests" `
/d:sonar.test.inclusions="**/*Tests.cs" `
/d:sonar.coverageReportPaths="TestResults/Reports/SonarQube.xml"
dotnet build "${{ env.Solution }}" --configuration Release --no-restore
# Run Unit Tests
dotnet test "${{ env.UnitTest_Project }}" `
--collect:"XPlat Code Coverage" `
--results-directory TestResults/UnitTests `
--configuration Release `
--logger "console;verbosity=detailed" `
--filter "TestCategory!=Long-Running"
# Run Integration Tests
dotnet test "${{ env.IntegrationTest_Project }}" `
--collect:"XPlat Code Coverage" `
--results-directory TestResults/IntegrationTests `
--configuration Release `
--logger "console;verbosity=detailed"
# Generate coverage reports
dotnet tool run reportgenerator `
-reports:TestResults/**/coverage.cobertura.xml `
-targetdir:TestResults/Reports `
-reporttypes:"Html;lcov;SonarQube;Cobertura" `
dotnet tool run dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
- name: Upload to Coveralls
uses: coverallsapp/github-action@v2
with:
path-to-lcov: TestResults/Reports/lcov.info
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
- name: Upload Test Coverage Report
uses: actions/upload-artifact@v4
with:
name: test-coverage-report
path: TestResults/Reports