-
-
Notifications
You must be signed in to change notification settings - Fork 952
Migrate from AppVeyor to GitHub Actions #1539
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
57b4eb9
Migrate from AppVeyor to GitHub Actions
mus65 b3960c6
also run on pull_request
mus65 908d440
small formatting improvements
mus65 17d29f8
add on: workflow_dispatch
mus65 5933063
Merge remote-tracking branch 'upstream/develop' into githubactions
mus65 4d756d4
Publish NuGet package to GitHub Registry
mus65 8451593
re-add empty appveyor.yml
mus65 8a2c9bf
fix appveyor
mus65 b926828
typo
mus65 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,165 @@ | ||
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 | ||
with: | ||
dotnet-version: 8.0.x | ||
|
||
- name: Build Unit Tests .NET | ||
run: dotnet build -f net8.0 test/Renci.SshNet.Tests/ | ||
|
||
- name: Build IntegrationTests .NET | ||
run: dotnet build -f net8.0 test/Renci.SshNet.IntegrationTests/ | ||
|
||
- name: Build IntegrationTests .NET Framework | ||
run: dotnet build -f net48 test/Renci.SshNet.IntegrationTests/ | ||
|
||
- name: Run Unit Tests .NET | ||
run: | | ||
dotnet test \ | ||
-f net8.0 \ | ||
--no-build \ | ||
--logger "console;verbosity=normal" \ | ||
--logger GitHubActions \ | ||
-p:CollectCoverage=true \ | ||
-p:CoverletOutputFormat=cobertura \ | ||
-p:CoverletOutput=../../coverlet/linux_unit_test_net_8_coverage.xml \ | ||
test/Renci.SshNet.Tests/ | ||
|
||
- name: Run Integration Tests .NET | ||
run: | | ||
dotnet test \ | ||
-f net8.0 \ | ||
--no-build \ | ||
--logger "console;verbosity=normal" \ | ||
--logger GitHubActions \ | ||
-p:CollectCoverage=true \ | ||
-p:CoverletOutputFormat=cobertura \ | ||
-p:CoverletOutput=../../coverlet/linux_integration_test_net_8_coverage.xml \ | ||
test/Renci.SshNet.IntegrationTests/ | ||
|
||
# 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: Run Integration Tests Mono | ||
run: | | ||
sudo apt-get install ca-certificates gnupg | ||
sudo 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" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list | ||
sudo apt-get update | ||
sudo apt-get install mono-devel | ||
dotnet test \ | ||
-f net48 \ | ||
--no-build \ | ||
--logger "console;verbosity=normal" \ | ||
--logger GitHubActions \ | ||
-p:CollectCoverage=true \ | ||
-p:CoverletOutputFormat=cobertura \ | ||
-p:CoverletOutput=../../coverlet/linux_integration_test_net_48_coverage.xml \ | ||
--filter "Name~Ecdh|Name~ECDsa|Name~Zlib|Name~Gcm" \ | ||
test/Renci.SshNet.IntegrationTests/ | ||
|
||
- name: Archive Coverlet Results | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: Coverlet Results Linux | ||
path: coverlet | ||
|
||
Windows: | ||
runs-on: windows-2022 | ||
steps: | ||
- name: Checkout | ||
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: 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 net8.0 ` | ||
--no-build ` | ||
--logger "console;verbosity=normal" ` | ||
--logger GitHubActions ` | ||
-p:CollectCoverage=true ` | ||
-p:CoverletOutputFormat=cobertura ` | ||
-p:CoverletOutput=../../coverlet/windows_unit_test_net_8_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/ | ||
|
||
- 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 }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,5 @@ | ||
image: | ||
- Ubuntu2204 | ||
- Visual Studio 2022 | ||
# empty to avoid AppVeyor errors until it's disabled | ||
image: Ubuntu2204 | ||
|
||
services: | ||
- docker | ||
|
||
for: | ||
- | ||
matrix: | ||
only: | ||
- image: Ubuntu2204 | ||
|
||
init: | ||
- git config --global core.autocrlf input | ||
|
||
before_build: | ||
- sh: mkdir artifacts -p | ||
|
||
build_script: | ||
- echo build | ||
- dotnet build -f net8.0 -c Debug test/Renci.SshNet.Tests/Renci.SshNet.Tests.csproj | ||
- dotnet build -f net8.0 -c Debug test/Renci.SshNet.IntegrationTests/Renci.SshNet.IntegrationTests.csproj | ||
- dotnet build -f net48 -c Debug test/Renci.SshNet.IntegrationTests/Renci.SshNet.IntegrationTests.csproj | ||
|
||
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 -f net8.0 -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 | ||
# 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 | ||
- sh: dotnet test -f net48 -c Debug --no-restore --no-build --results-directory artifacts --logger Appveyor --logger "console;verbosity=normal" --logger "liquid.md;LogFileName=linux_integration_test_net_48_report.md" -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 | ||
|
||
- | ||
matrix: | ||
only: | ||
- image: Visual Studio 2022 | ||
|
||
init: | ||
- git config --global core.autocrlf true | ||
|
||
before_build: | ||
- ps: mkdir artifacts -f | ||
|
||
build_script: | ||
- echo build | ||
- dotnet build Renci.SshNet.sln -c Debug | ||
- dotnet publish -c Release -r win-x64 /warnaserror .\test\Renci.SshNet.AotCompatibilityTestApp\ | ||
- dotnet pack -c Release | ||
|
||
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 | ||
|
||
artifacts: | ||
- path: artifacts | ||
name: TestResults | ||
|
||
- path: src/**/*.nupkg | ||
- path: src/**/*.snupkg | ||
build_script: | ||
- echo done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.