11
11
DOTNET_NOLOGO : true
12
12
jobs :
13
13
build :
14
- name : ${{ matrix.name }}
14
+ name : Build
15
+ runs-on : ubuntu-20.04
16
+ steps :
17
+ - name : Checkout
18
+
19
+ with :
20
+ fetch-depth : 0
21
+ - name : Install .NET SDK
22
+
23
+ with :
24
+ dotnet-version : 6.0.x
25
+ - name : Build
26
+ run : dotnet build LibGit2Sharp.sln --configuration Release
27
+ - name : Upload packages
28
+
29
+ with :
30
+ name : NuGet packages
31
+ path : bin/Packages/
32
+ retention-days : 7
33
+ test :
34
+ name : Test / ${{ matrix.os }} / ${{ matrix.arch }} / ${{ matrix.tfm }}
15
35
runs-on : ${{ matrix.os }}
16
36
strategy :
17
37
matrix :
18
- include :
19
- - os : windows-2019
20
- name : Windows
21
- - os : ubuntu-20.04
22
- name : Linux
38
+ arch : [ amd64 ]
39
+ os : [windows-2019, macos-10.15]
40
+ tfm : [ net472, netcoreapp3.1, net5.0, net6.0 ]
41
+ exclude :
23
42
- os : macos-10.15
24
- name : macOS
43
+ tfm : net472
25
44
fail-fast : false
26
45
steps :
27
46
- name : Checkout
@@ -33,64 +52,54 @@ jobs:
33
52
with :
34
53
dotnet-version : 6.0.x
35
54
- name : Install .NET 5 runtime
55
+ if : matrix.tfm == 'net5.0'
36
56
37
57
with :
38
58
dotnet-version : 5.0.x
39
59
- name : Install .NET Core 3.1 runtime
60
+ if : matrix.tfm == 'netcoreapp3.1'
40
61
41
62
with :
42
63
dotnet-version : 3.1.x
43
- - name : Build
44
- run : dotnet build LibGit2Sharp.sln --configuration Release
45
- - name : Upload packages
46
- if : matrix.name == 'Windows'
47
-
48
- with :
49
- name : NuGet packages
50
- path : bin/Packages/
51
- retention-days : 7
52
- - name : Run net472 tests
53
- if : matrix.name == 'Windows'
54
- run : dotnet test LibGit2Sharp.sln --configuration Release --no-restore --framework net472 --logger "GitHubActions" /p:ExtraDefine=LEAKS_IDENTIFYING
55
- - name : Run netcoreapp3.1 tests
56
- run : dotnet test LibGit2Sharp.sln --configuration Release --no-restore --framework netcoreapp3.1 --logger "GitHubActions" /p:ExtraDefine=LEAKS_IDENTIFYING
57
- - name : Run net5.0 tests
58
- run : dotnet test LibGit2Sharp.sln --configuration Release --no-restore --framework net5.0 --logger "GitHubActions" /p:ExtraDefine=LEAKS_IDENTIFYING
59
- - name : Run net6.0 tests
60
- 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 }}
64
+ - name : Run ${{ matrix.tfm }} tests
65
+ run : dotnet test LibGit2Sharp.sln --configuration Release --framework ${{ matrix.tfm }} --logger "GitHubActions" /p:ExtraDefine=LEAKS_IDENTIFYING
66
+ test-linux :
67
+ name : Test / ${{ matrix.distro }} / ${{ matrix.arch }} / ${{ matrix.tfm }}
63
68
runs-on : ubuntu-20.04
64
69
strategy :
65
70
matrix :
66
71
arch : [ amd64 ]
67
72
# arch: [ amd64, arm64 ]
68
- sdk : [ '6.0', '5.0', '3.1' ]
69
73
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 ]
74
+ sdk : [ '6.0', '5.0', '3.1' ]
70
75
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
76
+ - arch : arm64
77
+ distro : alpine.3.12
78
+ - arch : arm64
79
+ distro : alpine.3.13
80
+ sdk : ' 3.1'
81
+ - arch : arm64
82
+ distro : alpine.3.14
83
+ sdk : ' 3.1'
84
+ - arch : arm64
85
+ distro : centos.7
86
+ include :
87
+ - sdk : ' 6.0'
88
+ tfm : net6.0
89
+ - sdk : ' 5.0'
90
+ tfm : net5.0
91
+ - sdk : ' 3.1'
92
+ tfm : netcoreapp3.1
81
93
fail-fast : false
82
94
steps :
83
95
- name : Checkout
84
96
85
97
with :
86
98
fetch-depth : 0
87
-
88
99
- name : Setup QEMU
100
+ if : matrix.arch == 'arm64'
89
101
run : docker run --rm --privileged multiarch/qemu-user-static:register --reset
90
-
91
- - name : Test with docker
102
+ - name : Run ${{ matrix.tfm }} tests
92
103
run : |
93
- [[ ${{ matrix.sdk }} = '3.1' ]] && target="netcoreapp${{ matrix.sdk }}" || target="net${{ matrix.sdk }}"
94
-
95
- test_command="dotnet test LibGit2Sharp.sln --configuration Release -p:TargetFrameworks=$target -p:ExtraDefine=LEAKS_IDENTIFYING -p:GeneratePackageOnBuild=false"
104
+ test_command="dotnet test LibGit2Sharp.sln --configuration Release -p:TargetFrameworks=${{ matrix.tfm }} --logger "GitHubActions" -p:ExtraDefine=LEAKS_IDENTIFYING"
96
105
docker run -t --rm --platform linux/${{ matrix.arch }} -v "$PWD:/app" gittools/build-images:${{ matrix.distro }}-sdk-${{ matrix.sdk }} sh -c "$test_command"
0 commit comments