Trying to improve the CI workflow.
Signed-off-by: Cliff Hill <xlorep@darkhelm.org>
This commit is contained in:
@@ -7,8 +7,8 @@ on:
|
||||
branches: [ main, develop ]
|
||||
|
||||
jobs:
|
||||
backend-tests:
|
||||
name: Backend Tests (Python 3.13 + uv)
|
||||
setup:
|
||||
name: Setup and Checkout
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
@@ -50,37 +50,37 @@ jobs:
|
||||
|
||||
cd ${{ github.workspace }}
|
||||
|
||||
# Test if SSH access is already configured
|
||||
echo "Testing SSH connectivity..."
|
||||
mkdir -p ~/.ssh
|
||||
# Try HTTP first (most reliable for current setup)
|
||||
echo "Attempting repository clone..."
|
||||
|
||||
# Try internal network access first (runner to gitea server)
|
||||
echo "Testing internal SSH connectivity to gitea:22..."
|
||||
ssh-keyscan -p 22 -H gitea >> ~/.ssh/known_hosts 2>/dev/null || echo "Internal SSH keyscan completed"
|
||||
|
||||
# Try external SSH access
|
||||
echo "Testing external SSH connectivity to dogar.darkhelm.org:2222..."
|
||||
ssh-keyscan -p 2222 -H dogar.darkhelm.org >> ~/.ssh/known_hosts 2>/dev/null || echo "External SSH keyscan completed"
|
||||
|
||||
# Check if we can connect via SSH (try internal first, then external)
|
||||
if ssh -T git@gitea 2>&1 | grep -q "successfully authenticated\|Hi.*You've successfully authenticated"; then
|
||||
echo "✓ Internal SSH authentication successful - using internal SSH clone"
|
||||
git clone --depth 1 git@gitea:DarkHelm.org/plex-playlist.git .
|
||||
elif ssh -T -p 2222 git@dogar.darkhelm.org 2>&1 | grep -q "successfully authenticated\|Hi.*You've successfully authenticated"; then
|
||||
echo "✓ External SSH authentication successful - using external SSH clone"
|
||||
git clone --depth 1 ssh://git@dogar.darkhelm.org:2222/DarkHelm.org/plex-playlist.git .
|
||||
# Try internal network HTTP first
|
||||
if git clone --depth 1 http://gitea:3000/DarkHelm.org/plex-playlist.git . 2>/dev/null; then
|
||||
echo "✓ Internal HTTP clone successful"
|
||||
# Try external HTTP
|
||||
elif git clone --depth 1 http://dogar.darkhelm.org/DarkHelm.org/plex-playlist.git . 2>/dev/null; then
|
||||
echo "✓ External HTTP clone successful"
|
||||
else
|
||||
echo "⚠ SSH authentication failed - checking available SSH keys"
|
||||
ls -la ~/.ssh/ || echo "No ~/.ssh directory"
|
||||
echo "Available environment variables:"
|
||||
env | grep -i ssh || echo "No SSH-related environment variables"
|
||||
echo "Falling back to HTTP clone..."
|
||||
# Try internal network first, then external
|
||||
if git clone --depth 1 http://gitea:3000/DarkHelm.org/plex-playlist.git . 2>/dev/null; then
|
||||
echo "Internal HTTP clone successful"
|
||||
echo "HTTP failed, trying SSH..."
|
||||
mkdir -p ~/.ssh
|
||||
|
||||
# Add known hosts
|
||||
echo "Adding SSH known hosts..."
|
||||
ssh-keyscan -p 22 -H gitea >> ~/.ssh/known_hosts 2>/dev/null || echo "Internal SSH keyscan completed"
|
||||
ssh-keyscan -p 2222 -H dogar.darkhelm.org >> ~/.ssh/known_hosts 2>/dev/null || echo "External SSH keyscan completed"
|
||||
|
||||
# Try SSH (internal first, then external)
|
||||
if ssh -T git@gitea 2>&1 | grep -q "successfully authenticated\|Hi.*You've successfully authenticated"; then
|
||||
echo "✓ Internal SSH authentication successful"
|
||||
git clone --depth 1 git@gitea:DarkHelm.org/plex-playlist.git .
|
||||
elif ssh -T -p 2222 git@dogar.darkhelm.org 2>&1 | grep -q "successfully authenticated\|Hi.*You've successfully authenticated"; then
|
||||
echo "✓ External SSH authentication successful"
|
||||
git clone --depth 1 ssh://git@dogar.darkhelm.org:2222/DarkHelm.org/plex-playlist.git .
|
||||
else
|
||||
echo "Internal HTTP failed, trying external..."
|
||||
git clone --depth 1 http://dogar.darkhelm.org/DarkHelm.org/plex-playlist.git .
|
||||
echo "❌ All clone methods failed"
|
||||
echo "SSH debug info:"
|
||||
ls -la ~/.ssh/ || echo "No ~/.ssh directory"
|
||||
ssh-add -l 2>/dev/null || echo "No SSH keys loaded"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -89,6 +89,27 @@ jobs:
|
||||
echo "Repository contents:"
|
||||
ls -la
|
||||
|
||||
- name: Upload source code
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: source-code
|
||||
path: |
|
||||
.
|
||||
!.git
|
||||
retention-days: 1
|
||||
|
||||
backend-tests:
|
||||
name: Backend Tests (Python 3.13 + uv)
|
||||
runs-on: ubuntu-latest
|
||||
needs: setup
|
||||
|
||||
steps:
|
||||
- name: Download source code
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: source-code
|
||||
path: .
|
||||
|
||||
- name: Install Python 3.13
|
||||
run: |
|
||||
# Add deadsnakes PPA for Python 3.13
|
||||
@@ -163,84 +184,14 @@ jobs:
|
||||
frontend-tests:
|
||||
name: Frontend Tests (TypeScript + Vue + Yarn Berry)
|
||||
runs-on: ubuntu-latest
|
||||
needs: setup
|
||||
|
||||
steps:
|
||||
- name: Debug SSH Setup
|
||||
run: |
|
||||
echo "=== SSH Debug Information ==="
|
||||
echo "SSH client version:"
|
||||
ssh -V 2>&1 || echo "SSH not available"
|
||||
|
||||
echo "SSH directory contents:"
|
||||
ls -la ~/.ssh/ 2>/dev/null || echo "No ~/.ssh directory"
|
||||
|
||||
echo "Checking for SSH keys in common locations:"
|
||||
find ~ -name "id_*" -type f 2>/dev/null || echo "No SSH keys found in home directory"
|
||||
find /root -name "id_*" -type f 2>/dev/null || echo "No SSH keys found in /root"
|
||||
find /data -name "id_*" -type f 2>/dev/null || echo "No SSH keys found in /data"
|
||||
|
||||
echo "SSH agent status:"
|
||||
ssh-add -l 2>/dev/null || echo "SSH agent not running or no keys loaded"
|
||||
|
||||
echo "Environment variables:"
|
||||
env | grep -E "(SSH|GIT)" || echo "No SSH/GIT environment variables"
|
||||
|
||||
echo "Runner filesystem info:"
|
||||
whoami
|
||||
pwd
|
||||
echo "HOME: $HOME"
|
||||
|
||||
echo "Docker environment check:"
|
||||
cat /proc/1/cgroup 2>/dev/null | head -3 || echo "Not in container or no cgroup info"
|
||||
|
||||
- name: Checkout code
|
||||
run: |
|
||||
echo "=== Repository Checkout ==="
|
||||
echo "Repository: ${{ github.repository }}"
|
||||
echo "Ref: ${{ github.ref }}"
|
||||
echo "SHA: ${{ github.sha }}"
|
||||
echo "Workspace: ${{ github.workspace }}"
|
||||
|
||||
cd ${{ github.workspace }}
|
||||
|
||||
# Test if SSH access is already configured
|
||||
echo "Testing SSH connectivity..."
|
||||
mkdir -p ~/.ssh
|
||||
|
||||
# Try internal network access first (runner to gitea server)
|
||||
echo "Testing internal SSH connectivity to gitea:22..."
|
||||
ssh-keyscan -p 22 -H gitea >> ~/.ssh/known_hosts 2>/dev/null || echo "Internal SSH keyscan completed"
|
||||
|
||||
# Try external SSH access
|
||||
echo "Testing external SSH connectivity to dogar.darkhelm.org:2222..."
|
||||
ssh-keyscan -p 2222 -H dogar.darkhelm.org >> ~/.ssh/known_hosts 2>/dev/null || echo "External SSH keyscan completed"
|
||||
|
||||
# Check if we can connect via SSH (try internal first, then external)
|
||||
if ssh -T git@gitea 2>&1 | grep -q "successfully authenticated\|Hi.*You've successfully authenticated"; then
|
||||
echo "✓ Internal SSH authentication successful - using internal SSH clone"
|
||||
git clone --depth 1 git@gitea:DarkHelm.org/plex-playlist.git .
|
||||
elif ssh -T -p 2222 git@dogar.darkhelm.org 2>&1 | grep -q "successfully authenticated\|Hi.*You've successfully authenticated"; then
|
||||
echo "✓ External SSH authentication successful - using external SSH clone"
|
||||
git clone --depth 1 ssh://git@dogar.darkhelm.org:2222/DarkHelm.org/plex-playlist.git .
|
||||
else
|
||||
echo "⚠ SSH authentication failed - checking available SSH keys"
|
||||
ls -la ~/.ssh/ || echo "No ~/.ssh directory"
|
||||
echo "Available environment variables:"
|
||||
env | grep -i ssh || echo "No SSH-related environment variables"
|
||||
echo "Falling back to HTTP clone..."
|
||||
# Try internal network first, then external
|
||||
if git clone --depth 1 http://gitea:3000/DarkHelm.org/plex-playlist.git . 2>/dev/null; then
|
||||
echo "Internal HTTP clone successful"
|
||||
else
|
||||
echo "Internal HTTP failed, trying external..."
|
||||
git clone --depth 1 http://dogar.darkhelm.org/DarkHelm.org/plex-playlist.git .
|
||||
fi
|
||||
fi
|
||||
|
||||
git checkout ${{ github.sha }} 2>/dev/null || echo "Using HEAD commit"
|
||||
|
||||
echo "Repository contents:"
|
||||
ls -la
|
||||
- name: Download source code
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: source-code
|
||||
path: .
|
||||
|
||||
- name: Install Node.js 24
|
||||
run: |
|
||||
|
||||
Reference in New Issue
Block a user