Update deep-source.yml #14
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: Restore NuGet Packages | |
run: nuget restore "${{ env.solution }}" | |
- name: Build Release | |
run: msbuild GuiStracini.Mandae.sln /p:Configuration=Release | |
- name: Test | |
run: coverlet Test\GuiStracini.Mandae.Tests\bin\Release\GuiStracini.Mandae.Tests.dll -t "vstest.console.exe" -a "\Test\GuiStracini.Mandae.Tests\bin\Release\GuiStracini.Mandae.Tests.dll" -o "\Test\GuiStracini.Mandae.Tests\bin\Release\\" | |
- name: Upload artifact test coverage | |
uses: actions/upload-artifact@v3.1.2 | |
with: | |
name: coverage | |
path: \Test\GuiStracini.Mandae.Tests\bin]Release | |
deep-source: | |
name: Deep Source Coverage report | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download release | |
uses: actions/download-artifact@v3 | |
with: | |
name: coverage | |
- name: Install DeepSource scanner | |
run: curl https://deepsource.io/cli | sh | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: '7.0.x' | |
- name: Build and analyze | |
env: | |
DEEPSOURCE_DSN: ${{ secrets.DEEPSOURCE_DSN }} | |
run: | | |
./bin/deepsource report --analyzer test-coverage --key csharp --value-file coverage.cobertura.xml |