Add read timeout control to SshSession and error handling for chann…
#28
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
| name: Test | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'src/**' | |
| - '**.csproj' | |
| - '**.sln' | |
| - '.github/workflows/test.yml' | |
| workflow_dispatch: | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '10.0.x' | |
| dotnet-quality: 'preview' | |
| - name: Set up Docker Compose | |
| uses: docker/setup-compose-action@v1 | |
| - name: Start Docker Compose services | |
| working-directory: ./src/NullOpsDevs.LibSsh.Test | |
| run: docker compose up --build -d | |
| - name: Setup SSH Agent | |
| run: | | |
| eval $(ssh-agent -s) | |
| echo "SSH_AUTH_SOCK=$SSH_AUTH_SOCK" >> $GITHUB_ENV | |
| echo "SSH_AGENT_PID=$SSH_AGENT_PID" >> $GITHUB_ENV | |
| cp src/NullOpsDevs.LibSsh.Test/docker/test-keys/id_rsa /tmp/id_rsa | |
| chmod 600 /tmp/id_rsa | |
| ssh-add /tmp/id_rsa | |
| - name: Build test project (Release) | |
| run: dotnet build -c Release --self-contained -r linux-x64 ./src/NullOpsDevs.LibSsh.Test/NullOpsDevs.LibSsh.Test.csproj | |
| - name: Run tests | |
| working-directory: ./src/NullOpsDevs.LibSsh.Test/bin/Release/net9.0/linux-x64/ | |
| run: ./NullOpsDevs.LibSsh.Test | |
| - name: Cleanup Docker Compose | |
| if: always() | |
| working-directory: ./src/NullOpsDevs.LibSsh.Test | |
| run: docker compose down -v |