Skip to content

Initial CI/CD #2

@Flash0ver

Description

@Flash0ver

I imagine the CI and CD workflows to be a combination of previous projects, but all in GitHub Actions (no Azure DevOps):

Workflows

  • CI workflow
    • on push to main and Pull Requests
    • Job "Restore & Build & Test" (individually, as most important job to diagnose potential issues quicker)
      • matrix all 3 OS
      • optional: matrix Debug and Release configuration
      • Step: Restore
        • explicitly use root nuget.config
        • no caching
      • Step: Build (no restore)
      • Step: Test (no build)
        • fail workflow if any test fails
        • in any case, still complete the other OS/Configuration test run
        • if failed, do not run run code coverage nor mutation testing
    • Job: "Collect Code Coverage"
      • package coverlet.collector already added for both test projects
      • on Linux only
      • Step: restore .NET local tools
        • specify NuGet.config and dotnet-tools.json manifest explicitly
        • no caching
      • Step: Collect Code Coverage
        • Format: Cobertura
        • create and use .runsettings
          • to specify <Format>cobertura</Format> explicitly
          • to allow suppressing/excluding namespaces and files in the future
        • produce assets in ./artifacts/code-coverage
      • Step: Generate Report
        • via dotnet-reportgenerator-globaltool, install as local .NET tool
        • merge all Cobertura results via a wildcard pattern
        • Generate HTML
        • produce assets in ./artifacts/code-coverage
      • Step: Publish HTML Report Artifact
    • Job: Mutation Testing
      • via dotnet-stryker, install as local .NET tool
      • on Linux only
      • Step: restore .NET local tools
        • specify NuGet.config and dotnet-tools.json manifest explicitly
        • no caching
      • Step: run mutation testing and generate HTML report
        • create and use stryker-config.json for future configuration
        • produce assets in ./artifacts/mutation-testing
      • Step: publish HTML Report Artifact
  • CD workflow
    • on push to publish
    • on Linux only
    • Step: Run Tests (no coverage, no mutation testing, use implicit restore and build, Release-Configuration only)
      • fail pipeline if any test fails
    • Step: Pack
      • dotnet pack produces "Release" assets per default since .NET 8.0 ... but we could still explicitly set it
      • create NuGet package in ./artifacts/package
    • Step: Publish
      • NuGet Secret Name: NUGET_API_KEY
  • both
    • mind the new <ArtifactsPath>$(MSBuildThisFileDirectory)artifacts</ArtifactsPath> output paths
      • create output HTML artifacts within ./artifacts
    • set available "no-telemetry", "no-logo" and "no-first-time-experience" environment variables for the jobs
    • set --nologo option per .NET SDK command, if available
    • use specific OS label, that is equivalent to the current ...-latest (reproducible builds)
    • checkout depth: 1 (history is currently not required)
    • use SDK from global.json explicitly (reproducible builds, should an SDK be dropped from a runner, and also currently the .NET 8.0 SDK is not yet pre-installed in the GitHub-hosted runners)
    • use latest GitHub Actions currently available as stable release
    • consider pinning actions to the commit SHA of the release tag (and add actual version comment)
    • arguments passed to CLI arguments and options should be environment variables

Additional Workflows / Jobs

Metadata

Metadata

Assignees

Labels

changelog:noneNo consumer observable changes (no SemVer increment)scope:repoGitHub repository and/or Actionstype:cdChanges to our CD configuration files and scriptstype:ciChanges to our CI configuration files and scripts

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions