Skip to content

adjsut workflow

adjsut workflow #11

Workflow file for this run

name: 🛠️ .NET Aspire Workflow
on:
workflow_dispatch:
push:
branches:
- 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: Install azd
uses: Azure/setup-azd@v1.0.0
- name: Install .NET Aspire workload
run: dotnet workload install aspire
- 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/Aspire.Playground.AppHost.UnitTests -- 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