Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate with codecov #1257

Draft
wants to merge 10 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 28 additions & 17 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,25 @@ for:
- image: Ubuntu2204

install:
- sh: sudo apt-get update && sudo apt-get install -y dotnet-sdk-8.0=8.0.100-1
- sudo apt-get update && sudo apt-get install -y dotnet-sdk-8.0=8.0.100-1

before_build:
- sh: mkdir artifacts -p
# before_build:
# - sh: mkdir artifacts -p

build_script:
- echo build
- dotnet build Renci.SshNet.sln -c Debug -f net8.0

test_script:
- sh: echo "Run unit tests"
- sh: dotnet test -f net8.0 -c Debug --no-restore --no-build --results-directory artifacts --logger Appveyor --logger "console;verbosity=normal" --logger "liquid.md;LogFileName=linux_unit_test_net_8_report.md" -p:CollectCoverage=true -p:CoverletOutputFormat=cobertura -p:CoverletOutput=../../artifacts/linux_unit_test_net_8_coverage.xml test/Renci.SshNet.Tests/Renci.SshNet.Tests.csproj
- sh: echo "Run integration tests"
- sh: dotnet test -c Debug --no-restore --no-build --results-directory artifacts --logger Appveyor --logger "console;verbosity=normal" --logger "liquid.md;LogFileName=linux_integration_test_net_8_report.md" -p:CollectCoverage=true -p:CoverletOutputFormat=cobertura -p:CoverletOutput=../../artifacts/linux_integration_test_net_8_coverage.xml test/Renci.SshNet.IntegrationTests/Renci.SshNet.IntegrationTests.csproj
- echo "Run unit tests"
- dotnet test -f net8.0 -c Debug --no-build --logger Appveyor --logger "console;verbosity=normal" --collect "XPlat Code Coverage" /p:UseSourceLink=true test/Renci.SshNet.Tests/Renci.SshNet.Tests.csproj
- echo "Run integration tests"
- dotnet test -c Debug --no-build --logger Appveyor --logger "console;verbosity=normal" --collect "XPlat Code Coverage" /p:UseSourceLink=true test/Renci.SshNet.IntegrationTests/Renci.SshNet.IntegrationTests.csproj

after_test:
- curl -Os https://uploader.codecov.io/latest/linux/codecov
- sudo chmod +x codecov
- ./codecov

# on_failure:
# - sh: appveyor PushArtifact artifacts/tcpdump.pcap
Expand All @@ -36,24 +41,30 @@ for:
- image: Visual Studio 2022

install:
- ps: choco install dotnet-8.0-sdk --version=8.0.100
- choco install dotnet-8.0-sdk --version=8.0.100

before_build:
- ps: mkdir artifacts -f
# before_build:
# - ps: mkdir artifacts -f

build_script:
- echo build
- dotnet build Renci.SshNet.sln -c Debug

test_script:
- ps: echo "Run unit tests for .NET 8.0"
- ps: dotnet test -f net8.0 -c Debug --no-restore --no-build --results-directory artifacts --logger Appveyor --logger "console;verbosity=normal" --logger "liquid.md;LogFileName=windows_unit_test_net_8_report.md" -p:CollectCoverage=true -p:CoverletOutputFormat=cobertura -p:CoverletOutput=../../artifacts/windows_unit_test_net_8_coverage.xml test/Renci.SshNet.Tests/Renci.SshNet.Tests.csproj
- ps: echo "Run unit tests for .NET Framework 4.6.2"
- ps: dotnet test -f net462 -c Debug --no-restore --no-build --results-directory artifacts --logger Appveyor --logger "console;verbosity=normal" --logger "liquid.md;LogFileName=windows_unit_test_net_4_6_2_report.md" -p:CollectCoverage=true -p:CoverletOutputFormat=cobertura -p:CoverletOutput=../../artifacts/windows_unit_test_net_4_6_2_coverage.xml test/Renci.SshNet.Tests/Renci.SshNet.Tests.csproj
- echo "Run unit tests for .NET 8.0"
- dotnet test -f net8.0 -c Debug --no-build --logger Appveyor --logger "console;verbosity=normal" --collect "XPlat Code Coverage" /p:UseSourceLink=true test/Renci.SshNet.Tests/Renci.SshNet.Tests.csproj
- echo "Run unit tests for .NET Framework 4.6.2"
- dotnet test -f net462 -c Debug --no-build --logger Appveyor --logger "console;verbosity=normal" --collect "XPlat Code Coverage" /p:UseSourceLink=true test/Renci.SshNet.Tests/Renci.SshNet.Tests.csproj

after_test:
- ps: |
$ProgressPreference = 'SilentlyContinue'
Invoke-WebRequest -Uri https://uploader.codecov.io/latest/windows/codecov.exe -Outfile codecov.exe
.\codecov.exe

# on_failure:
# - ps: Push-AppveyorArtifact artifacts/tcpdump.pcap

artifacts:
- path: artifacts
name: artifacts
# artifacts:
# - path: artifacts
# name: artifacts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
<PackageReference Include="SSH.NET" Version="2023.0.0" ExcludeAssets="All" />

<PackageReference Include="Appveyor.TestLogger" Version="2.0.0" />
<PackageReference Include="LiquidTestReports.Markdown" Version="1.0.9" />
<PackageReference Include="coverlet.msbuild" Version="6.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
Expand Down
1 change: 0 additions & 1 deletion test/Renci.SshNet.Tests/Renci.SshNet.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
<PackageReference Include="Moq" Version="4.18.4" />

<PackageReference Include="Appveyor.TestLogger" Version="2.0.0" />
<PackageReference Include="LiquidTestReports.Markdown" Version="1.0.9" />
<PackageReference Include="coverlet.msbuild" Version="6.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
Expand Down