chore(deps): update danielpalme/reportgenerator-github-action action to v5.4.1 #249
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Continuous Integration | |
on: | |
push: | |
branches: | |
- main | |
- 'feature/**' | |
pull_request: | |
branches: [main] | |
jobs: | |
test: | |
name: Test | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: | | |
5.0.x | |
6.0.x | |
7.0.x | |
8.0.x | |
- name: Run tests | |
run: dotnet test --collect:"XPlat Code Coverage" --logger "GitHubActions" | |
- name: Upload coverage | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Code coverage ${{ matrix.os }} | |
path: "**/coverage.cobertura.xml" | |
coverage: | |
name: Coverage | |
needs: [test] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: Code coverage ubuntu-latest | |
path: coverage-ubuntu | |
- uses: actions/download-artifact@v4 | |
with: | |
name: Code coverage windows-latest | |
path: coverage-windows | |
- uses: actions/download-artifact@v4 | |
with: | |
name: Code coverage macos-latest | |
path: coverage-macos | |
- name: Generate coverage report | |
uses: danielpalme/ReportGenerator-GitHub-Action@5.3.0 | |
with: | |
reports: "**/coverage.cobertura.xml" | |
targetdir: "coverage-report" | |
reporttypes: "Cobertura" | |
- name: Publish coverage report to Codacy | |
uses: codacy/codacy-coverage-reporter-action@master | |
if: github.repository == 'System-IO-Abstractions/System.IO.Abstractions.Extensions' && github.event_name == 'push' | |
with: | |
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} | |
coverage-reports: coverage-report/Cobertura.xml | |
pack: | |
name: Pack | |
needs: [test] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
- name: Create packages | |
run: dotnet pack --configuration Release --output ./packages | |
- name: Upload a Build Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: NuGet packages | |
path: packages/*.* | |
deploy: | |
name: Deploy | |
if: github.ref == 'refs/heads/main' && github.event_name == 'push' | |
needs: [pack] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: NuGet packages | |
path: packages | |
- name: Push packages | |
run: dotnet nuget push "packages/*.nupkg" --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json | |
- uses: dotnet/nbgv@v0.4.2 | |
id: nbgv | |
- name: Create GitHub release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: v${{ steps.nbgv.outputs.SemVer2 }} | |
release_name: v${{ steps.nbgv.outputs.SemVer2 }} | |
- name: Comment relevant issues and merge requests | |
uses: apexskier/github-release-commenter@v1.3.6 | |
with: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
comment-template: | | |
This is addressed in release {release_link}. | |
label-template: | | |
state: released |