Add comprehensive network diagnostic workflow
Some checks failed
Network Diagnostic / network-test (push) Failing after 1s

Adaugă 12 steps de diagnostic pentru a înțelege exact ce vede job container-ul:
- /etc/hosts și DNS config
- nslookup/dig/ping tests pentru hostname "gitea"
- Network interfaces și routing
- Test HTTP connections (hostname vs IP direct)
- Environment variables
- Comparație între gitea:3000 și 172.18.0.4:3000

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
RJ
2025-10-27 15:02:28 +02:00
parent 06737db9cb
commit b74497b37f

View File

@@ -1,25 +1,85 @@
name: Test CI Pipeline
on: [push]
name: Network Diagnostic
on: [push, workflow_dispatch]
jobs:
test:
network-test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Run test
- name: 1. Basic Info
run: |
echo "Hello from Gitea Actions!"
echo "Runner: $(hostname)"
echo "Working directory: $(pwd)"
echo "👋 runner works"
echo "👋 changed act runner variable"
echo "👋 testing docker network"
echo "👋 testing docker network with direct ip"
ls -la
echo "=== Container Info ==="
hostname
whoami
pwd
echo ""
- name: Test Docker
- name: 2. Check /etc/hosts
run: |
docker --version
echo "Docker is available in CI!"
echo "=== /etc/hosts Contents ==="
cat /etc/hosts
echo ""
- name: 3. Check DNS Config
run: |
echo "=== /etc/resolv.conf ==="
cat /etc/resolv.conf
echo ""
- name: 4. Test DNS Resolution for 'gitea'
run: |
echo "=== nslookup gitea ==="
nslookup gitea || echo "nslookup failed with exit code: $?"
echo ""
- name: 5. Test DNS with dig (if available)
run: |
echo "=== dig gitea ==="
dig gitea @127.0.0.11 || echo "dig not available or failed"
echo ""
- name: 6. Test Ping
run: |
echo "=== ping -c 2 gitea ==="
ping -c 2 gitea || echo "ping failed with exit code: $?"
echo ""
- name: 7. Network Interfaces
run: |
echo "=== ip addr show ==="
ip addr show
echo ""
- name: 8. Routing Table
run: |
echo "=== ip route ==="
ip route
echo ""
- name: 9. Test HTTP Connection to gitea:3000
run: |
echo "=== curl -v gitea:3000 ==="
curl -v --max-time 5 http://gitea:3000/ || echo "curl failed with exit code: $?"
echo ""
- name: 10. Environment Variables
run: |
echo "=== Gitea-related ENV vars ==="
env | grep -i git || echo "No GITEA env vars"
echo ""
echo "=== All ENV vars ==="
env | sort
- name: 11. Docker Network Info (if docker available)
run: |
echo "=== Docker Info ==="
docker network ls 2>/dev/null || echo "Docker not available in job container"
echo ""
- name: 12. Test Direct IP Connection
run: |
echo "=== Test connection to Gitea IP directly ==="
echo "Trying 172.18.0.4:3000 (known Gitea IP)..."
curl -v --max-time 5 http://172.18.0.4:3000/ || echo "Direct IP connection failed with exit code: $?"
echo ""