Skip to content

add coverage

add coverage #701

Workflow file for this run

name: Checkmarx One Visual Studio Extension CI
on:
pull_request:
workflow_dispatch:
permissions:
contents: write
jobs:
integration-tests:
runs-on: windows-latest
permissions:
contents: write
steps:
- name: Fetch Sources
uses: actions/checkout@v4
- name: Setup VSTest
uses: darenm/Setup-VSTest@v1
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v2
with:
msbuild-architecture: 'x64'
- name: Restore NuGet packages
run: nuget restore
- name: Restore .NET Packages
run: dotnet restore
- name: Build Solution
run: msbuild /p:Configuration=Release /p:DeployExtension=False
- name: Run Tests with Coverage
env:
CX_APIKEY: ${{ secrets.CX_APIKEY }}
run: |
dotnet test ./ast-visual-studio-extension-tests/ast-visual-studio-extension-tests.csproj \
--configuration Release \
/p:CollectCoverage=true \
/p:CoverletOutputFormat=cobertura \
/p:CoverletOutput=./coverage/coverage.xml
- name: Upload Coverage Report
uses: actions/upload-artifact@v3
with:
name: coverage-report
path: ./coverage/coverage.xml
- name: Report Coverage
uses: gaboel/nunit-to-html@v1
with:
input: './coverage/coverage.xml'
output: './coverage/coverage.html'