libgit2 / libgit2sharp

Git + .NET = ❤
http://libgit2.github.com
MIT License
3.15k stars 887 forks source link

Test native libraries using docker for multiple distros #1921

Closed arturcic closed 2 years ago

arturcic commented 2 years ago

Adds a test project that references the LibGit2Sharp. Adds a native-test GitHub workflow that builds and the runs the test project to test the native libraries are loaded properly This test project is build inside a docker image and the the docker image is run

arturcic commented 2 years ago

@bording may you have a look on this PR?

bording commented 2 years ago

This PR has some interesting ideas, but it's clear that it's been ported over from another repo (GitVersion?), so it has things that we don't need if we're actually part of this repo.

Thoughts while looking at the PR:

Thoughts?

arturcic commented 2 years ago

Thoughts while looking at the PR:

  • There's no need for a separate solution. The test project should be part of the main solution. Agree, I can move it under the main solution.

  • There's no need to customize the version of the native binaries package. It should just run against whatever version the main project is referencing.

This was needed at the time the NativeLibraries was not published to nuget and that was the reason in the PR for the NativeLibraries I included publishing to GitHub Packages.

  • Do we even need a separate load check project? I'm wondering if it would be a good idea to instead run the entire test suite, triggering whenever a CI workflow is run. I can have a look on what can be done, as the Docker images I used to test, contain the dotnet sdk, and that means we can run the dotnet test there. It might take some time to run all the images and all the tests so in that case I suggest to run it in a separate flow, and not the main one, but that is something you need to decide
arturcic commented 2 years ago

This PR has some interesting ideas, but it's clear that it's been ported over from another repo (GitVersion?), so it has things that we don't need if we're actually part of this repo.

That is true, I use the same docker images to test GitVersion (including LibGit2Sharp part of GitVersion). but the Docker images are just the base images of each distro, with the dotnet sdk/runtime native dependencies for each distro, and on top of that the .net sdk/runtime installed depending on the selected version. So basically the images contain only dotnet and the dependencies needed to run dotnet. There is no GitVersion specific packages/code there.

arturcic commented 2 years ago

@bording I reworked the PR. Now the tests are run inside of docker containers for several distros and .net versions. Unfortunately I had to disable te arm64 jobs as they run for quite a long of time. If you don't mind we keep only the amd64 jobs for now I can later check how to enable in another PR.

bording commented 2 years ago

Thanks for the PR. Eventually I think want to move to use docker images that are in this repo to give a bit more control. For example, I'd prefer to always use the latest SDK, and then have additional runtimes installed as needed for the tests.

That can be done later, and this is a great first step!