Skip to content

Support for more than 1 cobertura.xml file #19

@victormarante

Description

@victormarante

Feature Request

I currently have a action.yml file that will run dotnet test on a .NET 5 project. I have two tests projects, and this will in turn create two separate cobertura.xml files.

As you can see in my .yml file below, I will copy both files with the 'cp' command, however, only one of them will be picked up, since I need to specify one particular file. I would like to be able to either: a) consolidate my two xml files into one, or b) be able to specify more than 1 xml file in the summary step (which would require your action to somehow merge the two or more files into one single file).

action.yml

name: .Net 5 CI Build

on:
  workflow_dispatch:
  pull_request:
    branches: [ master ]

env:
  Database:ConnectionString: ${{ secrets.SQL_CONNECTIONSTRING }}

jobs:
  build:
    runs-on: ubuntu-latest
    name: CI Build
    steps:
    - name: Az login
      uses: azure/login@v1
      with:
        creds: ${{ secrets.AZURE_CREDENTIALS }}

    - name: Checkout
      uses: actions/checkout@v2

    - name: Setup .NET
      uses: actions/setup-dotnet@v1
      with:
        dotnet-version: 5.0.x

    - name: Restore Dependencies
      run: dotnet restore

    - name: Build
      run: dotnet build --configuration Release --no-restore

    - name: Test
      run: dotnet test --configuration Release --no-build --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./coverage

    - name: Copy Coverage To Predictable Location
      run: cp -n coverage/**/coverage.cobertura.xml coverage/

    - name: Code Coverage Summary Report
      uses: irongut/[email protected]
      with:
        filename: coverage/coverage.cobertura.xml
        badge: true
        format: 'markdown'
        output: 'both'

    - name: Add Coverage PR Comment
      uses: marocchino/sticky-pull-request-comment@v2
      if: github.event_name == 'pull_request'
      with:
        recreate: true
        path: code-coverage-results.md

    - name: AZ logout
      run: |
        az logout

Expected Behaviour

Support for more than 1 cobertura.xml file in CodeCoverageSummary action.

Metadata

Metadata

Assignees

Labels

OptionsAn issue related to the Action's parameters.ParsingAn issue reletad to parsing the coverage xml.SummaryAn issue related to creating the code coverage summary.enhancementNew feature or request

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions