Skip to content

Commit 474472e

Browse files
committed
added job for running tests in docker for several distros
1 parent abdd8fb commit 474472e

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed

.github/workflows/ci.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,39 @@ jobs:
5858
run: dotnet test LibGit2Sharp.sln --configuration Release --no-restore --framework net5.0 --logger "GitHubActions" /p:ExtraDefine=LEAKS_IDENTIFYING
5959
- name: Run net6.0 tests
6060
run: dotnet test LibGit2Sharp.sln --configuration Release --no-restore --framework net6.0 --logger "GitHubActions" /p:ExtraDefine=LEAKS_IDENTIFYING
61+
native_test:
62+
name: Test on [${{ matrix.arch }}] net${{ matrix.sdk }} SDK - ${{ matrix.distro }}
63+
runs-on: ubuntu-20.04
64+
strategy:
65+
matrix:
66+
arch: [ amd64 ]
67+
# arch: [ amd64, arm64 ]
68+
sdk: [ '6.0', '5.0', '3.1' ]
69+
distro: [ alpine.3.12, alpine.3.13, alpine.3.14, centos.7, centos.8, debian.9, debian.10, debian.11, fedora.33, ubuntu.18.04, ubuntu.20.04 ]
70+
exclude:
71+
- arch: arm64
72+
distro: alpine.3.12
73+
- arch: arm64
74+
distro: alpine.3.13
75+
sdk: '3.1'
76+
- arch: arm64
77+
distro: alpine.3.14
78+
sdk: '3.1'
79+
- arch: arm64
80+
distro: centos.7
81+
fail-fast: false
82+
steps:
83+
- name: Checkout
84+
uses: actions/[email protected]
85+
with:
86+
fetch-depth: 0
87+
88+
- name: Setup QEMU
89+
run: docker run --rm --privileged multiarch/qemu-user-static:register --reset
90+
91+
- name: Test with docker
92+
run: |
93+
[[ ${{ matrix.sdk }} = '3.1' ]] && target="netcoreapp${{ matrix.sdk }}" || target="net${{ matrix.sdk }}"
94+
95+
test_command="dotnet test LibGit2Sharp.sln --configuration Release --framework $target -p:ExtraDefine=LEAKS_IDENTIFYING -p:GeneratePackageOnBuild=false"
96+
docker run -t --rm --platform linux/${{ matrix.arch }} -v "$PWD:/app" gittools/build-images:${{ matrix.distro }}-sdk-${{ matrix.sdk }} sh -c "$test_command"

LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net472;netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
4+
<TargetFrameworks Condition="'$(TargetFrameworks)'==''">net472;netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
55
</PropertyGroup>
66

77
<ItemGroup>

0 commit comments

Comments
 (0)