Packages update (CI) (#79) #40
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deep Source | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
types: [opened, synchronize, reopened] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
name: Build | |
runs-on: windows-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: Setup MSBuild Path | |
uses: microsoft/setup-msbuild@v1.3 | |
env: | |
ACTIONS_ALLOW_UNSECURE_COMMANDS: true | |
- name: Setup Nuget | |
uses: NuGet/setup-nuget@v1.2 | |
env: | |
ACTIONS_ALLOW_UNSECURE_COMMANDS: true | |
- name: Setup VSTest | |
uses: darenm/Setup-VSTest@v1.2 | |
- name: DotNet Tool Install Coverlet | |
run: dotnet tool install --global coverlet.console | |
- name: Set solution name | |
run: | | |
echo "solution=$([io.path]::GetFileNameWithoutExtension($(Get-ChildItem -Path .\* -Include *.sln)))" | Out-File -FilePath $env:GITHUB_ENV -Append | |
- name: Restore NuGet Packages | |
run: nuget restore ${{ env.solution }}.sln | |
- name: Build Release | |
run: msbuild ${{ env.solution }}.sln /p:Configuration=Release | |
- name: Test | |
run: coverlet Tests\${{ env.solution }}.Tests\bin\Release\${{ env.solution }}.Tests.dll -t "vstest.console.exe" -a "Tests\${{ env.solution }}.Tests\bin\Release\${{ env.solution }}.Tests.dll" -o "Tests\${{ env.solution }}.Tests\bin\Release\\" -f cobertura | |
- name: Upload artifact test coverage | |
uses: actions/upload-artifact@v3.1.3 | |
with: | |
name: coverage | |
path: Tests\${{ env.solution }}.Tests\bin\Release\coverage.cobertura.xml | |
deep-source: | |
name: Deep Source Coverage report | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: Download artifact test coverage | |
uses: actions/download-artifact@v3 | |
with: | |
name: coverage | |
- name: Install DeepSource scanner | |
run: curl https://deepsource.io/cli | sh | |
- name: Analyze | |
env: | |
DEEPSOURCE_DSN: ${{ secrets.DEEPSOURCE_DSN }} | |
run: ./bin/deepsource report --analyzer test-coverage --key csharp --value-file coverage.cobertura.xml |