mirror of
https://github.com/sshnet/SSH.NET.git
synced 2026-09-11 13:39:09 +00:00
9f733e4393
Bumps [Vampire/setup-wsl](https://github.com/vampire/setup-wsl) from 5.0.1 to 6.0.0. - [Release notes](https://github.com/vampire/setup-wsl/releases) - [Commits](https://github.com/vampire/setup-wsl/compare/3b46b44374d5d0ae94654c45d114a3ed7a0e07a8...6a8db447be7ed35f2f499c02c6e60ff77ef11278) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
173 lines
5.0 KiB
YAML
173 lines
5.0 KiB
YAML
name: Build
|
|
|
|
on:
|
|
- push
|
|
- pull_request
|
|
- workflow_dispatch
|
|
|
|
jobs:
|
|
Linux:
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0 # needed for Nerdbank.GitVersioning
|
|
|
|
- name: Setup .NET
|
|
uses: actions/setup-dotnet@v4
|
|
|
|
- name: Build Unit Tests .NET
|
|
run: dotnet build -f net9.0 test/Renci.SshNet.Tests/
|
|
|
|
- name: Build IntegrationTests .NET
|
|
run: dotnet build -f net9.0 test/Renci.SshNet.IntegrationTests/
|
|
|
|
- name: Run Unit Tests .NET
|
|
run: |
|
|
dotnet test \
|
|
-f net9.0 \
|
|
--no-build \
|
|
--logger "console;verbosity=normal" \
|
|
--logger GitHubActions \
|
|
-p:CollectCoverage=true \
|
|
-p:CoverletOutputFormat=cobertura \
|
|
-p:CoverletOutput=../../coverlet/linux_unit_test_net_9_coverage.xml \
|
|
test/Renci.SshNet.Tests/
|
|
|
|
- name: Run Integration Tests .NET
|
|
run: |
|
|
dotnet test \
|
|
-f net9.0 \
|
|
--no-build \
|
|
--logger "console;verbosity=normal" \
|
|
--logger GitHubActions \
|
|
-p:CollectCoverage=true \
|
|
-p:CoverletOutputFormat=cobertura \
|
|
-p:CoverletOutput=../../coverlet/linux_integration_test_net_9_coverage.xml \
|
|
test/Renci.SshNet.IntegrationTests/
|
|
|
|
- name: Archive Coverlet Results
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: Coverlet Results Linux
|
|
path: coverlet
|
|
|
|
Windows:
|
|
runs-on: windows-2025
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0 # needed for Nerdbank.GitVersioning
|
|
|
|
- name: Setup .NET
|
|
uses: actions/setup-dotnet@v4
|
|
|
|
- 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: Archive NuGet Package
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: NuGet Package
|
|
path: src/Renci.SshNet/bin/Release/*.*nupkg
|
|
|
|
- name: Run Unit Tests .NET
|
|
run: |
|
|
dotnet test `
|
|
-f net9.0 `
|
|
--no-build `
|
|
--logger "console;verbosity=normal" `
|
|
--logger GitHubActions `
|
|
-p:CollectCoverage=true `
|
|
-p:CoverletOutputFormat=cobertura `
|
|
-p:CoverletOutput=../../coverlet/windows_unit_test_net_9_coverage.xml `
|
|
test/Renci.SshNet.Tests/
|
|
|
|
- name: Run Unit Tests .NET Framework
|
|
run: |
|
|
dotnet test `
|
|
-f net462 `
|
|
--no-build `
|
|
--logger "console;verbosity=normal" `
|
|
--logger GitHubActions `
|
|
-p:CollectCoverage=true `
|
|
-p:CoverletOutputFormat=cobertura `
|
|
-p:CoverletOutput=../../coverlet/windows_unit_test_net_4_6_2_coverage.xml `
|
|
test/Renci.SshNet.Tests/
|
|
|
|
Windows-Integration-Tests:
|
|
name: Windows Integration Tests
|
|
runs-on: windows-2025
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0 # needed for Nerdbank.GitVersioning
|
|
|
|
- name: Setup .NET
|
|
uses: actions/setup-dotnet@v4
|
|
|
|
- name: Setup WSL2
|
|
uses: Vampire/setup-wsl@6a8db447be7ed35f2f499c02c6e60ff77ef11278 # v6.0.0
|
|
with:
|
|
distribution: Ubuntu-24.04
|
|
|
|
- name: Setup SSH Server
|
|
shell: wsl-bash {0}
|
|
run: |
|
|
apt-get update && apt-get upgrade -y
|
|
apt-get install -y podman
|
|
podman build -t renci-ssh-tests-server-image -f test/Renci.SshNet.IntegrationTests/Dockerfile test/Renci.SshNet.IntegrationTests/
|
|
podman run --rm -h renci-ssh-tests-server -d -p 2222:22 renci-ssh-tests-server-image
|
|
|
|
- name: Run Integration Tests .NET Framework
|
|
run:
|
|
dotnet test `
|
|
-f net48 `
|
|
--logger "console;verbosity=normal" `
|
|
--logger GitHubActions `
|
|
-p:CollectCoverage=true `
|
|
-p:CoverletOutputFormat=cobertura `
|
|
-p:CoverletOutput=..\..\coverlet\windows_integration_test_net_4_8_coverage.xml `
|
|
test\Renci.SshNet.IntegrationTests\
|
|
|
|
- name: Archive Coverlet Results
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: Coverlet Results Windows
|
|
path: coverlet
|
|
|
|
Publish:
|
|
runs-on: ubuntu-24.04
|
|
if: github.ref == 'refs/heads/develop'
|
|
permissions:
|
|
packages: write
|
|
needs:
|
|
- Windows
|
|
- Linux
|
|
steps:
|
|
- name: Download NuGet Package
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: NuGet Package
|
|
|
|
- name: Publish to GitHub NuGet Registry
|
|
run: |
|
|
dotnet nuget add source \
|
|
--username $GITHUB_ACTOR \
|
|
--password ${{ secrets.GITHUB_TOKEN }} \
|
|
--store-password-in-clear-text \
|
|
--name github \
|
|
"https://nuget.pkg.github.com/$GITHUB_REPOSITORY_OWNER/index.json"
|
|
dotnet nuget push "*.nupkg" \
|
|
--source github \
|
|
--api-key ${{ secrets.GITHUB_TOKEN }}
|