forked from kubernetes-client/csharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathci.sh
More file actions
executable file
·39 lines (32 loc) · 1.23 KB
/
ci.sh
File metadata and controls
executable file
·39 lines (32 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env bash
# Exit on any error
set -e
# Ensure no compile errors in all projects
find . -name *.csproj -exec dotnet build {} \;
# Create the NuGet package
cd src/KubernetesClient/
dotnet pack -c Release
cd ../..
# Execute Unit tests
cd tests/KubernetesClient.Tests
dotnet restore
# Save the test results to a file
# Collect code coverage of the KuberetsClient assembly, but exclude the
# auto-generated models from the coverage reports.
dotnet test \
-l "trx;LogFileName=KubernetesClient.Tests.xunit.trx" \
/p:CollectCoverage=true \
/p:Include="[KubernetesClient]*" \
/p:Exclude="[KubernetesClient]k8s.Models.*" \
/p:Exclude="[KubernetesClient]k8s.Internal.*" \
/p:CoverletOutputFormat="opencover" \
/p:CoverletOutput="KubernetesClient.Tests.opencover.xml"
cd ..
echo Generating Code Coverage reports
export PATH="$PATH:$HOME/.dotnet/tools"
export DOTNET_ROOT=$(dirname $(realpath $(which dotnet))) # https://github.com/dotnet/cli/issues/9114#issuecomment-401670622
dotnet tool install --global dotnet-reportgenerator-globaltool --version 4.0.15
reportgenerator "-reports:**/*.opencover.xml" "-targetdir:coveragereport" "-reporttypes:HTMLInline;Cobertura"
ls coveragereport
ls coveragereport/Cobertura.xml
cd ..