Update deep-source.yml #24
Workflow file for this run
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@v3 | |
with: | |
fetch-depth: 0 | |
- 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.2 | |
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: | |
- uses: actions/checkout@v3 | |
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: Build and analyze | |
env: | |
DEEPSOURCE_DSN: ${{ secrets.DEEPSOURCE_DSN }} | |
run: ./bin/deepsource report --analyzer test-coverage --key csharp --value-file coverage.cobertura.xml |