Skip to content

mono

mono #10

Workflow file for this run

name: Build
on: [ push ]
jobs:
Linux:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # needed for Nerdbank.GitVersioning
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Build Unit Tests .NET
run: dotnet build -f net8.0 test/Renci.SshNet.Tests/Renci.SshNet.Tests.csproj
- name: Build IntegrationTests .NET
run: dotnet build -f net8.0 test/Renci.SshNet.IntegrationTests/Renci.SshNet.IntegrationTests.csproj
- name: Build IntegrationTests .NET Framework
run: dotnet build -f net48 test/Renci.SshNet.IntegrationTests/Renci.SshNet.IntegrationTests.csproj
- name: Run Unit Tests .NET
run: |
dotnet test \
-f net8.0 \
--no-restore \
--no-build \
--results-directory artifacts \
--logger "console;verbosity=normal" \
-p:CollectCoverage=true \
-p:CoverletOutputFormat=cobertura \
-p:CoverletOutput=../../artifacts/linux_unit_test_net_8_coverage.xml \
test/Renci.SshNet.Tests/Renci.SshNet.Tests.csproj
- name: Run Integration Tests .NET
run: |
dotnet test \
-f net8.0 \
--no-restore \
--no-build \
--results-directory artifacts \
--logger "console;verbosity=normal" \
-p:CollectCoverage=true \
-p:CoverletOutputFormat=cobertura \
-p:CoverletOutput=../../artifacts/linux_integration_test_net_8_coverage.xml \
test/Renci.SshNet.IntegrationTests/Renci.SshNet.IntegrationTests.csproj
# Also run a subset of the integration tests targeting netfx using mono. This is a temporary measure to get
# some coverage until a proper solution for running the .NET Framework integration tests in CI is found.
# Running all the tests causes problems which are not worth solving in this rare configuration.
# See https://github.com/sshnet/SSH.NET/pull/1462 and related links
- name: Install Mono
run: |
apt install ca-certificates gnupg
gpg --homedir /tmp --no-default-keyring --keyring /usr/share/keyrings/mono-official-archive-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb [signed-by=/usr/share/keyrings/mono-official-archive-keyring.gpg] https://download.mono-project.com/repo/ubuntu stable-focal main" > /etc/apt/sources.list.d/mono-official-stable.list
apt update
apt-get install mono-devel
- name: Run Integration Tests Mono
run: |
dotnet test \
-f net48 \
--no-restore \
--no-build \
--results-directory artifacts \
--logger "console;verbosity=normal" \
-p:CollectCoverage=true \
-p:CoverletOutputFormat=cobertura \
-p:CoverletOutput=../../artifacts/linux_integration_test_net_48_coverage.xml \
--filter "Name~Ecdh|Name~ECDsa|Name~Zlib|Name~Gcm" \
test/Renci.SshNet.IntegrationTests/Renci.SshNet.IntegrationTests.csproj
Windows:
runs-on: windows-2022
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # needed for Nerdbank.GitVersioning
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
- name: Build Solution
run: dotnet build Renci.SshNet.sln
- name: Publish AOT Compatibility Test App
run: dotnet publish -r win-x64 /warnaserror .\test\Renci.SshNet.AotCompatibilityTestApp\
- name: Create NuGet Package
run: dotnet pack
- name: Run Unit Tests .NET
run: |
dotnet test \
-f net8.0 \
--no-restore \
--no-build \
--results-directory artifacts \
--logger "console;verbosity=normal" \
-p:CollectCoverage=true \
-p:CoverletOutputFormat=cobertura \
-p:CoverletOutput=../../artifacts/windows_unit_test_net_8_coverage.xml \
test/Renci.SshNet.Tests/Renci.SshNet.Tests.csproj
- name: Run Unit Tests .NET Framework
run: |
dotnet test \
-f net462 \
--no-restore \
--no-build \
--results-directory artifacts \
--logger "console;verbosity=normal" \
-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