Skip to content

Commit b90a6a9

Browse files
committed
Revise workflows to better integrate them
1 parent bd7f5da commit b90a6a9

File tree

1 file changed

+53
-44
lines changed

1 file changed

+53
-44
lines changed

.github/workflows/ci.yml

Lines changed: 53 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,36 @@ env:
1111
DOTNET_NOLOGO: true
1212
jobs:
1313
build:
14-
name: ${{ matrix.name }}
14+
name: Build
15+
runs-on: ubuntu-20.04
16+
steps:
17+
- name: Checkout
18+
uses: actions/[email protected]
19+
with:
20+
fetch-depth: 0
21+
- name: Install .NET SDK
22+
uses: actions/[email protected]
23+
with:
24+
dotnet-version: 6.0.x
25+
- name: Build
26+
run: dotnet build LibGit2Sharp.sln --configuration Release
27+
- name: Upload packages
28+
uses: actions/[email protected]
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 }}
1535
runs-on: ${{ matrix.os }}
1636
strategy:
1737
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:
2342
- os: macos-10.15
24-
name: macOS
43+
tfm: net472
2544
fail-fast: false
2645
steps:
2746
- name: Checkout
@@ -33,64 +52,54 @@ jobs:
3352
with:
3453
dotnet-version: 6.0.x
3554
- name: Install .NET 5 runtime
55+
if: matrix.tfm == 'net5.0'
3656
uses: actions/[email protected]
3757
with:
3858
dotnet-version: 5.0.x
3959
- name: Install .NET Core 3.1 runtime
60+
if: matrix.tfm == 'netcoreapp3.1'
4061
uses: actions/[email protected]
4162
with:
4263
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-
uses: actions/[email protected]
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 }}
6368
runs-on: ubuntu-20.04
6469
strategy:
6570
matrix:
6671
arch: [ amd64 ]
6772
# arch: [ amd64, arm64 ]
68-
sdk: [ '6.0', '5.0', '3.1' ]
6973
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' ]
7075
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
8193
fail-fast: false
8294
steps:
8395
- name: Checkout
8496
uses: actions/[email protected]
8597
with:
8698
fetch-depth: 0
87-
8899
- name: Setup QEMU
100+
if: matrix.arch == 'arm64'
89101
run: docker run --rm --privileged multiarch/qemu-user-static:register --reset
90-
91-
- name: Test with docker
102+
- name: Run ${{ matrix.tfm }} tests
92103
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"
96105
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

Comments
 (0)