nHapi icon indicating copy to clipboard operation
nHapi copied to clipboard

Create CI/CD Pipeline

Open milkshakeuk opened this issue 5 years ago • 10 comments

Below is a sample of the things we would like to automate

  • [x] ~~Build the base projects~~
  • [ ] Run the source code generator
  • [x] ~~Run the linter? (maybe use StyleCopAnalyzers along with .editorconfig to define style rules?~~
  • [x] ~~Build the complete source code including generated code~~
  • [x] ~~Execute the unit tests (for each target framework)~~
  • [x] ~~Run Coverage tests?~~
  • [x] ~~Publish results as comment to PR~~
  • [ ] Generate the NuGet package (auto increment the build NuGet package version (maybe based on branch name?)
  • [ ] Create a release (in GitHub - only when we choose to do so since there might be come ceremony as part of this i.e. release notes etc not sure yet.)
  • [ ] Upload to nuget.org (only when we choose to publish)
  • [ ] Auto publish preview NuGet packages? on successful merge?

If we can use GitHub Actions then great since it will be nicely self-contained within GitHub otherwise other free pipeline tools could work also as long as they integrate with GitHub PR for example Azure DevOps Pipelines?

milkshakeuk avatar Oct 30 '20 14:10 milkshakeuk

@jakubsuchybio I have created the GitHub Project board and created this ticket. Happy to discuss if you need anything?

milkshakeuk avatar Oct 30 '20 14:10 milkshakeuk

Nice! Well, I already built few pipelines in Azure DevOps without .yaml (the old clicky one style). I think it would be much better to leverage GitHub Actions, so we don't need to manage two sets of users in Github and in Azure DevOps. I haven't done anything in Github Actions, but I'm eager to try it for a long time.

As I'm looking at the repo. There is a lot of going on. I think it would greatly helped me, if I knew the sequence of the existing tooling from getting from the clean repo to built nuget package. With that I could start automating it.

But first I would suggest restructuring the repo: (we can ofc create separate issues for that)

  1. Structure of the repo like this:
root
    build - for scripts for building if any will exist
    docs - maybe for generated docs or for some guidelines, etc
    src - source code
    tests - test projects
    .gitignore
    .editorconfig
    changelog.md
    main.sln
    readme.md
  1. Move from .nuspec to having nuget building params inside .csproj (and with that leverage building the nuget through dotnet cli)

Also I don't quite understand why there are 2 .sln files, can we do with only one which has all the projects included?

jakubsuchybio avatar Oct 30 '20 19:10 jakubsuchybio

@jakubsuchybio I agree I did something very similar for NHapiTools see here. I added support for netstandard, restructured the project (almost identical to how u describe bit had a tools folder instead of a a build folder) and added some very basic GitHub actions.

If u want to create an issue for project structure please do so and I'll add it to the Kanban board (GitHub project).

Not sure about the nuspec suggestion but I'm happy to be convinced 😄.

I think it has 2 solutions because it needs to be able to build the code is which generates the code if that makes sense. I do want to move the source generating code out of NHapi.base though at some point, even the original java Hapi has the source generator outside of the main library.

milkshakeuk avatar Oct 30 '20 19:10 milkshakeuk

@jakubsuchybio I have created an issue for project re-structure #126 this should probably wait until the netstandard PR has been merged.

milkshakeuk avatar Nov 02 '20 13:11 milkshakeuk

@jakubsuchybio I have created a pull request for the project restructure #129

milkshakeuk avatar Nov 06 '20 12:11 milkshakeuk

That is great! Thanks for the info and sorry for what looks like ghosting from me. Lately my time for OSS and other stuff is really limited.

jakubsuchybio avatar Nov 06 '20 14:11 jakubsuchybio

@jakubsuchybio ok #129 has been merged, the project has been restructured. 👍

milkshakeuk avatar Nov 27 '20 20:11 milkshakeuk

@milkshakeuk do you want to/want me to spin off another issue to add StyleCopAnalysers to the main projects?

Happy to pick that up and start fixing the warnings - could use that ticket to discuss/agree basic styling rules? I'm happy with the StyleCop defaults, but don't have any strong opinions.

AMCN41R avatar Jan 30 '21 15:01 AMCN41R

@AMCN41R sounds good to me!

milkshakeuk avatar Jan 30 '21 16:01 milkshakeuk

If anybody else wants this, I'll gladly give it up :) because I'm in process of moving to another flat and have basically 0 time for OSS :(

jakubsuchybio avatar Jan 30 '21 16:01 jakubsuchybio