This repo holds common GitHub Actions Workflows that we use in the repositories we maintain.
This makes use of GitHub's Reusable Workflows.
In this section, we'll mention workflows and any details required for using them.
This Pull Request will publish a Code Coverage comment to a PR, as seen in this PR for eShopOnNServiceBus.
Some things to note:
-
This only comments on a
pull_requestevent. -
This requires 3 parameters:
- pr-number: PR Number to comment on
- code-coverage-artifact-name: Used for downloading the code-coverage artifact created in a build pipeline
- code-coverage-artifact-path: Used for the commenter plugin
To use this in your own repo, add this job to your workflow:
add-code-coverage-to-pr:
uses: NimblePros/NimblePros.GitHub.Workflows/.github/workflows/comment-on-pr.yml@main
with:
pr-number: YOUR_PR_NUMBER
code-coverage-artifact-name: YOUR_CODE_COVERAGE_ARTIFACT_NAME
code-coverage-artifact-path: YOUR_CODE_COVERAGE_ARTIFACT_PATHYou can see this in action with eShopOnNServiceBus.
Runs dotnet format against a solution or project. It can either check formatting or apply formatting fixes back to a pull request branch.
jobs:
dotnet-format:
uses: NimblePros/NimblePros.GitHub.Workflows/.github/workflows/dotnet-format.yml@main
with:
solution-or-project: ./YourSolution.slnBuilds, packs, and publishes a .NET project to NuGet.
jobs:
publish:
uses: NimblePros/NimblePros.GitHub.Workflows/.github/workflows/dotnet-publish.yml@main
with:
project-file: ./src/YourProject/YourProject.csproj
secrets:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}Runs restore, build, test, and coverage reporting for a .NET solution or project.
jobs:
test-coverage:
uses: NimblePros/NimblePros.GitHub.Workflows/.github/workflows/dotnet-test-coverage.yml@main
with:
solution-path: ./YourSolution.sln