add workflow #1
Workflow file for this run
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: 🛠️ .NET Aspire Workflow | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- develop | |
- feature/* | |
pull_request: | |
branches: | |
- main | |
- develop | |
jobs: | |
build: | |
name: 🛠️ Build and test | |
runs-on: ubuntu-latest | |
steps: | |
- name: 👨💻 Check-out code | |
uses: actions/checkout@v4 | |
- name: 👨🔧 Setup .NET Core SDK | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.x | |
- name: 🔍 Enable problem matchers | |
run: echo "::add-matcher::.github/matchers/dotnet.json" | |
- name: 🎒 Load packages | |
run: dotnet restore | |
- name: 🛠️ Build code | |
run: dotnet build --configuration Release --no-restore --warnaserror | |
- name: 🫣 Testing code | |
run: | | |
echo "## ❔ Test results" >> $GITHUB_STEP_SUMMARY | |
dotnet test --configuration Release -v minimal --no-build --logger GitHubActions '/p:CollectCoverage=true;CoverletOutputFormat="json,lcov,cobertura";MergeWith=${{github.workspace}}/coverage.json;CoverletOutput=${{github.workspace}}/coverage' src/*.UnitTests*.csproj -- RunConfiguration.CollectSourceInformation=true | |
- name: 📝 Code Coverage report | |
run: | | |
dotnet tool install --global dotnet-reportgenerator-globaltool --version 5.1.23 | |
reportgenerator -reports:${{github.workspace}}/coverage.cobertura.xml -targetdir:${{github.workspace}}/report -reporttypes:MarkdownSummaryGithub "-filefilters:-*.g.cs;-*.gen.cs" -verbosity:Warning | |
sed -i 's/# Summary/## 📝 Code Coverage/g' ${{github.workspace}}/report/SummaryGithub.md | |
sed -i 's/## Coverage/### Code Coverage details/g' ${{github.workspace}}/report/SummaryGithub.md | |
cat ${{github.workspace}}/report/*.md >> $GITHUB_STEP_SUMMARY |