Files
test-repository/.gitea/workflows/test.yml
RJ b74497b37f
Some checks failed
Network Diagnostic / network-test (push) Failing after 1s
Add comprehensive network diagnostic workflow
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>
2025-10-27 15:02:28 +02:00

86 lines
2.3 KiB
YAML

name: Network Diagnostic
on: [push, workflow_dispatch]
jobs:
network-test:
runs-on: ubuntu-latest
steps:
- name: 1. Basic Info
run: |
echo "=== Container Info ==="
hostname
whoami
pwd
echo ""
- name: 2. Check /etc/hosts
run: |
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 ""