Skip to content

move file

move file #1

Workflow file for this run

# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: CI - Badges
permissions:
contents: read
issues: read
checks: write
on:
push:
branches: [ "main","feature/*" ]
env:
solutionPath: '${{ github.workspace }}/src/Dataverse.ConfigurationMigrationTool/Dataverse.ConfigurationMigrationTool.sln'
solutionFolder: '${{ github.workspace }}/src/Dataverse.ConfigurationMigrationTool'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore ${{ env.solutionPath }}
- name: Build
run: dotnet build ${{ env.solutionPath }} --configuration Release --no-restore
- name: Execute unit tests
run: dotnet test ${{ env.solutionPath }} --configuration Release --settings ${{ env.solutionFolder }}/Console.Tests/CodeCoverage.runsettings --no-build --logger trx --no-restore --results-directory "TestResults" --collect:"XPlat code coverage"
- name: Publish Test Report
uses: phoenix-actions/test-reporting@v8
id: test-report # Set ID reference for step
if: ${{ (success() || failure()) && (github.event_name == 'pull_request') }} # run this step even if previous step failed
with:
name: unit tests # Name of the check run which will be created
path: TestResults/*.trx # Path to test results
reporter: dotnet-trx # Format of test results
- name: Create Test Coverage Badge
uses: simon-k/[email protected]
id: create_coverage_badge
with:
label: Unit Test Coverage
color: brightgreen
path: TestResults/*/coverage.opencover.xml
gist-filename: code-coverage.json
gist-id: ${{ env.GIST_REPO_ID }}
gist-auth-token: ${{ secrets.GIST_AUTH_TOKEN }}
- name: Print code coverage
run: echo "Code coverage percentage ${{steps.create_coverage_badge.outputs.percentage}}%"