-
Notifications
You must be signed in to change notification settings - Fork 2
84 lines (71 loc) · 2.62 KB
/
Copy pathssh-localhost.yml
File metadata and controls
84 lines (71 loc) · 2.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: SSH Localhost Test
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
workflow_dispatch:
jobs:
skip-on-claude:
if: ${{ !startsWith(github.head_ref, 'claude/' ) && !startsWith(github.ref, 'refs/heads/claude/') }}
runs-on: ubuntu-latest
steps:
- run: echo "Skipped"
ssh-localhost-test:
name: SSH localhost on Ubuntu with Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.11']
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -e .
pip install pytest
pip install getpass4
- name: Setup SSH server
run: |
echo "Installing and starting SSH server..."
sudo apt-get update
sudo apt-get install -y openssh-server
sudo systemctl enable ssh
sudo systemctl start ssh
echo "✓ SSH server installed and started"
echo "Configuring SSH key authentication..."
sudo sed -i 's/PasswordAuthentication yes/PasswordAuthentication no/g' /etc/ssh/sshd_config
sudo sed -i 's/#PubkeyAuthentication no/PubkeyAuthentication yes/g' /etc/ssh/sshd_config
sudo sed -i 's/#ChallengeResponseAuthentication yes/ChallengeResponseAuthentication no/g' /etc/ssh/sshd_config
echo "Restarting sshd service..."
sudo systemctl restart sshd
echo "✓ SSH configuration complete"
- name: Start SSH agent
run: |
echo "Starting SSH agent..."
eval "$(ssh-agent -s)"
echo "SSH_AUTH_SOCK=$SSH_AUTH_SOCK" >> $GITHUB_ENV
echo "SSH_AGENT_PID=$SSH_AGENT_PID" >> $GITHUB_ENV
echo "✓ SSH agent started"
- name: Verify SSH server is running
run: |
echo "Checking if SSH server is listening..."
ss -tln | grep :22 || netstat -an | grep LISTEN | grep :22
echo "✓ SSH server is running"
- name: Run SSH localhost test
run: |
python -m pytest tests/test_ssh_localhost.py::test_ssh_localhost_with_dedicated_key -v -s
- name: Run SSH error reporting integration tests
run: |
pip install paramiko
python -m pytest tests/test_error_reporting.py::TestSSHIntegrationErrorReporting -v -s --tb=long
- name: Test summary
if: always()
run: |
echo "SSH localhost connectivity test completed"