Skip to content

Add link to the github packages feed for nightlies. #552

Add link to the github packages feed for nightlies.

Add link to the github packages feed for nightlies. #552

Workflow file for this run

name: CI Build
on:
workflow_dispatch:
push:
branches:
- 'main'
paths-ignore:
- 'docs/**'
- '.github/**'
pull_request:
branches:
- 'main'
permissions:
contents: read
env:
DOTNET_GENERATE_ASPNET_CERTIFICATE: false
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
COVERAGE_REPORT: ${{ github.workspace}}/coveragereport
jobs:
build:
name: Build and Test
runs-on: ubuntu-latest
permissions:
contents: read
issues: read
pull-requests: write
checks: write
steps:
- name: 'Harden Runner'
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
with:
egress-policy: audit
- name: 'Checkout'
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
persist-credentials: false
- name: 'Setup .NET SDK'
uses: actions/setup-dotnet@d4c94342e560b34958eacfc5d055d21461ed1c5d # v5.0.0
with:
dotnet-version: |
8.0.x
9.0.x
- name: 'Restore external dependencies'
run: dotnet restore
- name: 'Build'
id: build
run: dotnet build --configuration Debug --no-restore
- name: Upload Build Artifacts
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: build-artifacts
path: |
src/**/idunno.*.nupkg
src/**/idunno.*.dll
src/**/idunno.*.deps.json
src/**/idunno.*.xml
retention-days: 5
- name: 'Test'
id: test
run: dotnet test --no-build --restore --collect:"XPlat Code Coverage" --logger junit --settings .runsettings
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@3a74b2957438d0b6e2e61d67b05318aa25c9e6c6 # v2.20.0
if: always()
with:
files: "test/**/TestResults.xml"
- name: Upload Test Artifacts
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: test-results
path: "test/**/TestResults.xml"
retention-days: 5
- name: 'Generate Full Code Coverage Reports'
uses: danielpalme/ReportGenerator-GitHub-Action@e15fac9a0be12d67bc1edd3a7b379b298cc186f5 # 5.4.13
with:
reports: "test/**/coverage.cobertura.xml"
targetdir: "${{ env.COVERAGE_REPORT }}"
reporttypes: "Cobertura,MarkdownSummaryGithub"
verbosity: "Info"
title: "Code Coverage"
tag: "${{ github.run_number }}_${{ github.run_id }}"
toolpath: "reportgeneratortool"
license: ${{ secrets.REPORT_GENERATOR_LICENSE }}
- name: Append coverage report to build summary
shell: bash
run: cat ${COVERAGE_REPORT}/SummaryGithub.md >> $GITHUB_STEP_SUMMARY
- name: Upload Code Coverage Results
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: coverage-results
path: |
${{ env.COVERAGE_REPORT }}
test/**/coverage.cobertura.xml
retention-days: 5