Open Flash0ver opened 11 months ago
Do you need some help to setup CI/CD?
@Gh0stWalk3r I could use some help indeed ... as I'm currently focusing on getting "Benchmarking" and "Testing" for Roslyn Source Generators going, that I then also intend to dog-feed this project with.
I updated the description with what I had in mind so far. But different suggestions are welcome! I know it's a lot ... feel free to build a smaller subset: e.g. skip Mutation Testing for now ... I'll open follow-up issues for the parts not included for now.
Thank you for your interest in contributing to FlashOWare.Generators
. I appreciate it!
Looks very well thought out 👍🏼
Another possibility to publish new packages is to manually create a releases in GitHub or applying a tag, which will run the publish (CD) workflow. This way you are applying version tags to e.g. the master branch and do not need a publish branch. Releases could also contain a generated summary of the changes/commits. When working with releases, do you also want to attach the published NuGet package to the release as artifact/asset?
In the meantime I will start working on the CI workflow.
I love the idea of publishing a package triggered by creating a Release. My publish
-branch-"flow" I used so far was only due to my lack of knowledge that new (Pre-)Releases can also be a trigger (I'm quite bad with GitHub Actions, I really appreciate the help here!). I guess we can get rid of the publish
branch altogether.
Will that also trigger when editing a release? E.g. adding/editing description, or only on initial creation with a tag?
I don't necessarily require the NuGet package to be part of the artifacts / assets ... but if you think that's a good idea, please feel free to add it. I mean, as part of a Release, the package will be on NuGet.org anyway.
But, from a workflow perspective: perhaps not on every push to a PR, but only on merging a PR to main
... so that we at least also dotnet pack
and get potential NuGet Warnings as Errors to fail the build. And maybe not adding the package to the artifacts of a main
build, but publishing it to GitHub Packages instead, so that this feed could be used as a "latest canary" feed for testing and experimentation. Would be cool to use the "current" version + the main's commit SHA as SemVer-Style "Build Metadata" for the GitHub Packages version. But I'm a bit unsure how to auto-increment the version number correctly here. Perhaps we do need something like Nerdbank.GitVersioning
and can no longer have a Fetch-Depth of 1.
What do you think about that?
(I have the feeling I'm becoming victim of feature creeping ... let's develop a bit of a "plan" here, and then open incremental issues for the CI/CD scope)
I intend to post the reports in the pull requests as markdown.
@Flash0ver can you please check if the read/write permission for actions/workflows is enabled?
They can be found in Settings > Actions > General > Workflow
Info taken from the plugin creator: https://github.com/marocchino/sticky-pull-request-comment/tree/v2/?tab=readme-ov-file#error-resource-not-accessible-by-integration
✔️ done (workflow permissions)
I imagine the CI and CD workflows to be a combination of previous projects, but all in GitHub Actions (no Azure DevOps):
Workflows
main
and Pull RequestsDebug
andRelease
configurationnuget.config
coverlet.collector
already added for both test projectsNuGet.config
anddotnet-tools.json
manifest explicitly.runsettings
<Format>cobertura</Format>
explicitly./artifacts/code-coverage
dotnet-reportgenerator-globaltool
, install as local .NET tool./artifacts/code-coverage
dotnet-stryker
, install as local .NET toolNuGet.config
anddotnet-tools.json
manifest explicitlystryker-config.json
for future configuration./artifacts/mutation-testing
publish
dotnet pack
produces "Release" assets per default since .NET 8.0 ... but we could still explicitly set it./artifacts/package
NUGET_API_KEY
<ArtifactsPath>$(MSBuildThisFileDirectory)artifacts</ArtifactsPath>
output paths./artifacts
--nologo
option per .NET SDK command, if available...-latest
(reproducible builds)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)Additional Workflows / Jobs
dotnet list package --vulnerable --include-transitive