Skip to content

Bump the minor-and-patch group with 3 updates #43

Bump the minor-and-patch group with 3 updates

Bump the minor-and-patch group with 3 updates #43

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.x'
- name: Restore
run: dotnet restore src/Endpointer.slnx
- name: Build
run: dotnet build src/Endpointer.slnx --no-restore -c Release
- name: Test with Coverage
run: |
dotnet tool install -g dotnet-coverage
dotnet-coverage collect -s src/coverage.runsettings -f cobertura -o ./coverage/coverage.cobertura.xml "dotnet test --solution src/Endpointer.slnx --no-build -c Release --verbosity normal"
- name: Generate Coverage Report
run: |
dotnet tool install -g dotnet-reportgenerator-globaltool
reportgenerator -reports:./coverage/coverage.cobertura.xml -targetdir:./coverage/report -reporttypes:"MarkdownSummaryGithub;Badges" -assemblyfilters:"+Endpointer"
- name: Add Coverage to Job Summary
if: always()
run: cat ./coverage/report/SummaryGithub.md >> $GITHUB_STEP_SUMMARY
- name: Pack
run: dotnet pack src/Endpointer/Endpointer.csproj --no-build -c Release -o ./artifacts
- name: Publish Coverage Badge
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
mkdir -p /tmp/badges
cp ./coverage/report/badge_linecoverage.svg /tmp/badges/
cp ./coverage/report/badge_branchcoverage.svg /tmp/badges/
if git ls-remote --exit-code --heads origin coverage; then
git fetch origin coverage:coverage
git switch coverage
else
git switch --orphan coverage
fi
cp /tmp/badges/*.svg .
git add badge_linecoverage.svg badge_branchcoverage.svg
if git diff --staged --quiet; then
echo "No changes to coverage badges"
else
git commit -m "Update coverage badges"
git push origin coverage
fi