Compare commits

..

9 Commits

Author SHA1 Message Date
irongut 71c6f23d2f use container from GHCR for Action #4 2021-09-06 01:11:36 +01:00
irongut 162def6e89 deploy step needs to checkout again #4 2021-09-06 00:58:20 +01:00
irongut e07628e8aa added deploy to GHCR workflow #4 2021-09-06 00:43:14 +01:00
irongut fc71f6831f merge PR #3 from dependabot/Microsoft.VisualStudio.Azure.Containers.Tools.Targets-1.11.1
Bump Microsoft.VisualStudio.Azure.Containers.Tools.Targets from 1.10.13 to 1.11.1
2021-09-05 23:15:14 +01:00
irongut c4d24d5996 merge PR #5 add empty line after badge from joshjohanning/master
adding empty line after badge so table renders properly
2021-09-05 23:09:40 +01:00
Joshua Johanning f5bcfce861 adding empty line after badge so table formats properly 2021-09-03 15:51:45 -05:00
dependabot[bot] a97b5158b3 Bump Microsoft.VisualStudio.Azure.Containers.Tools.Targets
Bumps Microsoft.VisualStudio.Azure.Containers.Tools.Targets from 1.10.13 to 1.11.1.

---
updated-dependencies:
- dependency-name: Microsoft.VisualStudio.Azure.Containers.Tools.Targets
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-10 23:11:27 +00:00
irongut e67bf0d2d1 updated documentation 2021-05-13 23:06:38 +01:00
irongut 1c05e17f24 updated readme 2021-05-10 23:30:39 +01:00
5 changed files with 71 additions and 7 deletions
+63
View File
@@ -0,0 +1,63 @@
name: Build + Deploy to GHCR
on:
release:
types: [published]
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build:
name: Test Build
runs-on: ubuntu-latest
steps:
- 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 src/CodeCoverageSummary.sln
- name: Build CodeCoverageSummary
run: dotnet build src/CodeCoverageSummary.sln --configuration Release --no-restore
- name: Test with sample file
run: dotnet src/CodeCoverageSummary/bin/Release/net5.0/CodeCoverageSummary.dll src/coverage.cobertura.xml --badge true
deploy:
name: Deploy to GHCR
needs: [build]
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build + Push Docker image
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
+5 -5
View File
@@ -1,8 +1,8 @@
# Code Coverage Summary # Code Coverage Summary
A GitHub Action that reads Cobertura format code coverage files and outputs a text or markdown summary. Other Actions can then post the summary as a pull request comment, include it in release notes, etc. A GitHub Action that reads Cobertura format code coverage files from your test suite and outputs a text or markdown summary. This summary can then be posted as a Pull Request comment, included in Release Notes, etc by another action to give you an immediate insight into the health of your code without using a third-party site.
Written for use with [Coverlet](https://github.com/coverlet-coverage/coverlet) and .Net but it should work with any tests that output coverage in Cobertura format. Code Coverage Summary was designed for use with [Coverlet](https://github.com/coverlet-coverage/coverlet) and .Net but it should work with any test framework that outputs coverage in Cobertura format.
## Inputs ## Inputs
@@ -52,7 +52,7 @@ Company.Example.Library: Line Rate = 27%, Branch Rate = 100%, Complexity = 11
```yaml ```yaml
name: Code Coverage Summary Report name: Code Coverage Summary Report
uses: irongut/CodeCoverageSummary@v1 uses: irongut/CodeCoverageSummary@v1.0.2
with: with:
filename: coverage/coverage.cobertura.xml filename: coverage/coverage.cobertura.xml
``` ```
@@ -94,7 +94,7 @@ jobs:
run: cp coverage/**/coverage.cobertura.xml coverage/coverage.cobertura.xml run: cp coverage/**/coverage.cobertura.xml coverage/coverage.cobertura.xml
- name: Code Coverage Summary Report - name: Code Coverage Summary Report
uses: irongut/CodeCoverageSummary@v1 uses: irongut/CodeCoverageSummary@v1.0.2
with: with:
filename: coverage/coverage.cobertura.xml filename: coverage/coverage.cobertura.xml
badge: true badge: true
@@ -115,7 +115,7 @@ jobs:
Please make sure the bug is not already reported by searching existing [issues]. Please make sure the bug is not already reported by searching existing [issues].
If you're unable to find an existing issue addressing the problem [open a new one][new-issue]. Be sure to include a title and clear description, as much relevant information as possible, a workflow sample and any logs demonstrating the problem. If you're unable to find an existing issue addressing the problem please [open a new one][new-issue]. Be sure to include a title and clear description, as much relevant information as possible, a workflow sample and any logs demonstrating the problem.
### Suggest an Enhancement ### Suggest an Enhancement
+1 -1
View File
@@ -22,7 +22,7 @@ inputs:
default: 'console' default: 'console'
runs: runs:
using: 'docker' using: 'docker'
image: 'Dockerfile' image: 'docker://ghcr.io/irongut/codecoveragesummary:v1.0.2'
args: args:
- ${{ inputs.filename }} - ${{ inputs.filename }}
- '--badge' - '--badge'
@@ -18,7 +18,7 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="CommandLineParser" Version="2.8.0" /> <PackageReference Include="CommandLineParser" Version="2.8.0" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.10.13" /> <PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.11.1" />
</ItemGroup> </ItemGroup>
</Project> </Project>
+1
View File
@@ -204,6 +204,7 @@ namespace CodeCoverageSummary
if (!string.IsNullOrWhiteSpace(badgeUrl)) if (!string.IsNullOrWhiteSpace(badgeUrl))
{ {
markdownOutput.AppendLine($"![Code Coverage]({badgeUrl})"); markdownOutput.AppendLine($"![Code Coverage]({badgeUrl})");
markdownOutput.AppendLine("");
} }
markdownOutput.AppendLine("Package | Line Rate | Branch Rate | Complexity") markdownOutput.AppendLine("Package | Line Rate | Branch Rate | Complexity")