Skip to content

Commit 6e08556

Browse files
authored
Merge pull request #5 from dotnetprog/feature/AddBadgesActionsToPipeline
ci badge
2 parents 1416bd9 + aed6f67 commit 6e08556

File tree

4 files changed

+67
-7
lines changed

4 files changed

+67
-7
lines changed

.github/workflows/ci-main.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# This workflow will build a .NET project
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
3+
4+
name: CI - Main
5+
permissions:
6+
contents: read
7+
issues: read
8+
checks: write
9+
on:
10+
push:
11+
branches: [ "main" ]
12+
13+
env:
14+
solutionPath: '${{ github.workspace }}/src/Dataverse.ConfigurationMigrationTool/Dataverse.ConfigurationMigrationTool.sln'
15+
solutionFolder: '${{ github.workspace }}/src/Dataverse.ConfigurationMigrationTool'
16+
jobs:
17+
build:
18+
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- uses: actions/checkout@v3
23+
- name: Setup .NET
24+
uses: actions/setup-dotnet@v3
25+
with:
26+
dotnet-version: 8.0.x
27+
- name: Restore dependencies
28+
run: dotnet restore ${{ env.solutionPath }}
29+
- name: Build
30+
run: dotnet build ${{ env.solutionPath }} --configuration Release --no-restore
31+
- name: Execute unit tests
32+
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"
33+
- name: Get first subfolder name
34+
id: get_subfolder
35+
shell: pwsh
36+
run: |
37+
$folderPath = 'TestResults'
38+
$firstGuidFolder = Get-ChildItem -Path $folderPath -Directory | Where-Object {
39+
[guid]::TryParse($_.Name, [ref]([guid]::Empty))
40+
} | Select-Object -First 1
41+
$name = if ($firstGuidFolder) { $firstGuidFolder.Name } else { "" }
42+
echo "subfolder_name=$name" >> $env:GITHUB_OUTPUT
43+
- name: Create Test Coverage Badge
44+
uses: simon-k/[email protected]
45+
id: create_coverage_badge
46+
with:
47+
label: Unit Test Coverage
48+
color: brightgreen
49+
path: TestResults/${{ steps.get_subfolder.outputs.subfolder_name }}/coverage.opencover.xml
50+
gist-filename: code-coverage.json
51+
gist-id: ${{ vars.GIST_REPO_ID }}
52+
gist-auth-token: ${{ secrets.GIST_AUTH_TOKEN }}
53+
- name: Print code coverage
54+
run: echo "Code coverage percentage ${{steps.create_coverage_badge.outputs.percentage}}%"
55+
56+
57+
58+
59+
60+
61+
62+
63+

.github/workflows/ci-pipeline.yml renamed to .github/workflows/ci-pipeline-validation.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
# This workflow will build a .NET project
22
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
33

4-
name: CI - Pipeline
4+
name: CI - Pipeline - Validation
55
permissions:
66
contents: read
77
issues: read
88
checks: write
99
pull-requests: write
1010
on:
11-
push:
12-
branches: [ "main","release/**/*" ]
1311
pull_request:
14-
branches: [ "main","release/*" ]
12+
branches: [ "main" ]
1513
env:
1614
solutionPath: '${{ github.workspace }}/src/Dataverse.ConfigurationMigrationTool/Dataverse.ConfigurationMigrationTool.sln'
1715
solutionFolder: '${{ github.workspace }}/src/Dataverse.ConfigurationMigrationTool'

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
2-
1+
![.Net](https://img.shields.io/badge/.NET_8_SDK-5C2D91?style=for-the-badge&logoColor=white) ![badge](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/dotnetprog/aa1b559b3f614ea0719286f9e2972219/raw/code-coverage.json)
32
# Dataverse Configuration Migration Tool
43

54
This repository contains a custom .NET CLI tool designed to import configuration data into Microsoft Dataverse environments. It streamlines the migration of configuration data, supports schema validation, and offers extensibility for advanced scenarios.

src/Dataverse.ConfigurationMigrationTool/Console.Tests/CodeCoverage.runsettings

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<DataCollectors>
55
<DataCollector friendlyName="XPlat code coverage">
66
<Configuration>
7-
<Format>cobertura</Format>
7+
<Format>cobertura,opencover</Format>
88
<Exclude>[*]Dataverse.ConfigurationMigrationTool.Console.Services.Dataverse*</Exclude>
99
<ExcludeByFile>**/Program.cs,</ExcludeByFile>
1010
<SkipAutoProps>true</SkipAutoProps>

0 commit comments

Comments
 (0)