22
22
LIB_PROJ : src/ICSharpCode.SharpZipLib/ICSharpCode.SharpZipLib.csproj
23
23
steps :
24
24
- uses : actions/checkout@v2
25
-
25
+ with :
26
+ fetch-depth : 0
27
+
26
28
- name : Setup .NET Core
27
29
uses : actions/setup-dotnet@v1
28
30
with :
@@ -39,46 +41,76 @@ jobs:
39
41
strategy :
40
42
fail-fast : false
41
43
matrix :
42
- os : [ubuntu, windows, macos]
44
+ # Windows testing is combined with code coverage
45
+ os : [ubuntu, macos]
43
46
target : [netcoreapp3.1]
44
- include :
45
- - os : windows
46
- target : net46
47
47
steps :
48
48
- uses : actions/checkout@v2
49
-
49
+ with :
50
+ fetch-depth : 0
51
+
50
52
- name : Setup .NET Core
51
53
if : matrix.target == 'netcoreapp3.1'
52
54
uses : actions/setup-dotnet@v1
53
55
with :
54
56
dotnet-version : ' 3.1.x'
55
57
56
- # NOTE: This is the temporary fix for https://github.com/actions/virtual-environments/issues/1090
57
- - name : Cleanup before restore
58
- if : ${{ matrix.os == 'windows' }}
59
- run : dotnet clean ICSharpCode.SharpZipLib.sln && dotnet nuget locals all --clear
60
-
61
58
- name : Restore test dependencies
62
59
run : dotnet restore
63
60
64
61
- name : Run tests (Debug)
65
62
run : dotnet test -c debug -f ${{ matrix.target }} --no-restore
66
63
67
64
- name : Run tests (Release)
68
- # Only upload code coverage for windows in an attempt to fix the broken code coverage
69
- if : ${{ matrix.os == 'windows' }}
70
- run : dotnet test -c release -f ${{ matrix.target }} --no-restore --collect="XPlat Code Coverage"
71
-
72
- - name : Run tests with coverage (Release)
73
- # Only upload code coverage for windows in an attempt to fix the broken code coverage
74
- if : ${{ matrix.os != 'windows' }}
75
65
run : dotnet test -c release -f ${{ matrix.target }} --no-restore
76
66
67
+
68
+ CodeCov :
69
+ name : Code Coverage
70
+ runs-on : windows-latest
71
+ env :
72
+ DOTCOVER_VER : 2021.1.2
73
+ DOTCOVER_PKG : jetbrains.dotcover.commandlinetools
74
+ COVER_SNAPSHOT : SharpZipLib.dcvr
75
+ steps :
76
+ - uses : actions/checkout@v2
77
+ with :
78
+ fetch-depth : 0
79
+
80
+ - name : Setup .NET
81
+ uses : actions/setup-dotnet@v1
82
+ with :
83
+ dotnet-version : ' 3.1.x'
84
+
85
+ # NOTE: This is the temporary fix for https://github.com/actions/virtual-environments/issues/1090
86
+ - name : Cleanup before restore
87
+ run : dotnet clean ICSharpCode.SharpZipLib.sln && dotnet nuget locals all --clear
88
+
89
+ - name : Install codecov
90
+ run : nuget install -o tools -version ${{env.DOTCOVER_VER}} ${{env.DOTCOVER_PKG}}
91
+
92
+ - name : Add dotcover to path
93
+ run : echo "$(pwd)\tools\${{env.DOTCOVER_PKG}}.${{env.DOTCOVER_VER}}\tools" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
94
+
95
+ - name : Run tests with code coverage
96
+ run : dotcover dotnet --output=${{env.COVER_SNAPSHOT}} --filters=-:ICSharpCode.SharpZipLib.Tests -- test -c release
97
+
98
+ - name : Create code coverage report
99
+ run : dotcover report --source=${{env.COVER_SNAPSHOT}} --reporttype=detailedxml --output=dotcover-report.xml
100
+
77
101
- name : Upload coverage to Codecov
78
102
103
+ with :
104
+ files : dotcover-report.xml
105
+
106
+ - name : Upload coverage snapshot artifact
107
+ uses : actions/upload-artifact@v2
108
+ with :
109
+ name : Code coverage snapshot
110
+ path : ${{env.COVER_SNAPSHOT}}
79
111
80
112
Pack :
81
- needs : [Build, Test]
113
+ needs : [Build, Test, CodeCov ]
82
114
runs-on : windows-latest
83
115
env :
84
116
PKG_SUFFIX : ' '
0 commit comments