Skip to content

Conversation

raman-m
Copy link
Member

@raman-m raman-m commented Jan 22, 2025

This PR introduces a new CI/CD setup based on the Building and Testing .NET workflow.

Proposed Changes

  • Removed CircleCI configuration → 68090bc
  • Added GitHub Actions configuration
  • Updated Visual Studio solution files

@raman-m raman-m self-assigned this Jan 22, 2025
@raman-m raman-m added the DevOps DevOps tasks: CI-CD, environments, and other scripts, configurations label Jan 22, 2025
@raman-m raman-m added this to the .NET 9 milestone Jan 22, 2025
@raman-m raman-m merged commit c0afa42 into develop Jan 22, 2025
4 of 5 checks passed
@raman-m raman-m deleted the cicd-github-actions branch January 22, 2025 13:43
Copy link
Member

@TomPallister TomPallister left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Raman, I would suggest continuing to use the ocelot container and cake build script because it also does the nuget publish and code coverage stuff. But the main advantage is you can build it locally in the same was as the CI server and know that there are no differences between your local environment and CI environment.

@raman-m
Copy link
Member Author

raman-m commented Jan 23, 2025

@TomPallister left a comment

I would suggest continuing to use the ocelot container and cake build script

First, regarding containers... The current prepared ocelot2 Docker images are simple Linux and Windows OS images with preinstalled .NET 8/9 SDKs (for .NET 9 milestone), and nothing more. The instantiated container is capable of building any .NET software, not just Ocelot. In fact, they are almost useless 😄 These containers serve as hosts in CircleCI env to run the build.cake and they act as Docker-hosted runners in the context of GitHub Actions.
Why not switch to native GitHub-hosted runners forever? To be fair, I do not want to spend my time creating Docker images with new .NET SDK versions. Also native GH-runners will allow us to improve building time.

Second, I agree to continue using build.cake, as it is the script for making releases. Note, the script must be adapted to new GH-Actions environment, because old CircleCI one required integration tokens in its variables.
Also, we need to abstract from Docker images/containers that run the script, so current GitHub-hosted runner works just fine. Another good news is the ability to run Cake scripts by GitHub action. There is a Cake-branded cake-action!


it also does the nuget publish and code coverage stuff

  1. Yes, it does! I believe GitHub Actions have some built-in actions that upload .NET project packages to NuGet. However, for now, we have to make releases and upload packages using the build.cake script, which must be adapted.

  2. The "Coverage stuff" is currently broken! It simply involves running the dotnet test command for the unit testing project with the special --collect:"XPlat Code Coverage" flag of the coverlet.collector library. It extracts the actual percentage coverage, but the number is not being uploaded to Coveralls due to outdated libraries related to the Cake engine. In 2024, I wrote to the repository owners and made a few contributions to the Cake.Coveralls repository. However, support is very slow, and sometimes they ignore my requests. I don't think the Coverage feature in Cake script is well-designed because of this outdated library; it will be outdated because .NET evolves quicker than this library! It would be better to migrate to a native app/action utilizing the official .NET Coveralls driver library for integrations. But you might find it a bit funny: support for this driver also seems to have stopped. The latest coveralls.net release was made almost 3 years ago and it has net6.0 TFM only. That's why I have disabled uploading to Coveralls 👉

    Ocelot/build.cake

    Lines 493 to 503 in ab119f8

    Information(string.Format("Uploading test coverage to {0}", coverallsRepo));
    // CoverallsNet(coverageSummaryFile, CoverallsNetReportType.OpenCover, new CoverallsNetSettings()
    // {
    // RepoToken = repoToken
    // });
    Warning($@"Uploading is disabled due to the following reasons:
    - App: /root/project/tools/csmacnz.Coveralls
    - Framework: 'Microsoft.NETCore.App', version '6.0.0' (x64)
    Upgrading csmacnz.Coveralls package to .NET 8-9 is required!!!
    Repo: https://github.com/csmacnz/coveralls.net
    Coveralls Language Integrations > .Net : https://docs.coveralls.io/dot-net");

I have opened PR csMACnz/coveralls.net#115 to release .NET 8-9 pack because the current TFM is net6.0 only. Unfortunately, author has not responded for two months and appears to be indifferent. The new Cake.Coveralls 4.0.0 pack may assist us as it includes net8.0 TFM. However, I currently pressed for time, and I must prioritize the release of the .NET 9 version.

@ggnaegi @RaynaldM FYI


Update 2

There are Coveralls Official Integrations.
And seems we must utilize the Coveralls GitHub Action

raman-m added a commit that referenced this pull request Apr 2, 2025
raman-m added a commit that referenced this pull request Apr 2, 2025
raman-m added a commit that referenced this pull request Apr 2, 2025
raman-m added a commit that referenced this pull request Apr 2, 2025
raman-m added a commit that referenced this pull request Apr 2, 2025
raman-m added a commit that referenced this pull request Apr 2, 2025
raman-m added a commit that referenced this pull request Apr 2, 2025
raman-m added a commit that referenced this pull request Apr 3, 2025
raman-m added a commit that referenced this pull request Apr 3, 2025
raman-m added a commit that referenced this pull request Apr 3, 2025
raman-m added a commit that referenced this pull request Apr 3, 2025
raman-m added a commit that referenced this pull request Apr 3, 2025
raman-m added a commit that referenced this pull request Apr 5, 2025
raman-m added a commit that referenced this pull request Apr 5, 2025
raman-m added a commit that referenced this pull request Apr 5, 2025
raman-m added a commit that referenced this pull request Apr 5, 2025
raman-m added a commit that referenced this pull request Apr 5, 2025
raman-m added a commit that referenced this pull request Apr 5, 2025
raman-m added a commit that referenced this pull request Apr 5, 2025
raman-m added a commit that referenced this pull request Apr 5, 2025
raman-m added a commit that referenced this pull request Apr 5, 2025
raman-m added a commit that referenced this pull request Apr 5, 2025
raman-m added a commit that referenced this pull request Apr 5, 2025
raman-m added a commit that referenced this pull request Apr 5, 2025
raman-m added a commit that referenced this pull request Apr 5, 2025
raman-m added a commit that referenced this pull request Apr 5, 2025
raman-m added a commit that referenced this pull request Apr 7, 2025
raman-m added a commit that referenced this pull request Apr 7, 2025
raman-m added a commit that referenced this pull request Apr 7, 2025
raman-m added a commit that referenced this pull request Apr 7, 2025
raman-m added a commit that referenced this pull request Apr 7, 2025
raman-m added a commit that referenced this pull request Apr 7, 2025
raman-m added a commit that referenced this pull request Apr 7, 2025
raman-m added a commit that referenced this pull request Apr 7, 2025
raman-m added a commit that referenced this pull request Apr 9, 2025
* EOL fix
* Packaging properties and assembly info
* Refactor test
* Fix package properties & tests
* Workaround for 'Setup .NET' step
* 'build' job should target to .NET 8
* Set up .NET 9 in the default user folder
raman-m added a commit that referenced this pull request Apr 9, 2025
raman-m added a commit that referenced this pull request Apr 10, 2025
* Add Coveralls step
* CoverageSummaryFile env var
* Env Variables
* Detect coverage file in Pre-Coveralls step
* Draft version of Prepare Coveralls step
* Disable Cake.Coveralls & coveralls.net outdated packs
* github context vars
* Job level env vars
raman-m added a commit that referenced this pull request Apr 10, 2025
raman-m added a commit that referenced this pull request Apr 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DevOps DevOps tasks: CI-CD, environments, and other scripts, configurations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants